[lustre-devel] HELP: difference between fallocate and truncate implementation
keguang xu <[email protected]> Mon, 18 Nov 2024 16:11:38 +0800
| Newsgroups | org.lustre.lists.lustre-devel |
|---|---|
| Message-ID | <CAF83deS+MC_ZKr9vXix_Js63ZyJ2KkXsSwLg5FeBs-+NziYf3Q@mail.gmail.com> |
Hi Lustre devs, I came across the code and noticed an implementation difference between fallocate and truncate/punch operations under the lustre/osd-ldiskfs/. While *osd_fallocate*() is handled in the Lustre OSD layer, *osd_punch*() remains in the ldiskfs layer, both of which may relate to multiple transactions as their comments suggested. - from LU-13765 <https://review.whamcloud.com/c/fs/lustre-release/+/39342>, it explains why move fallocate() from ldiskfs upto OSD layer (due to unpredictable credits ahead), however truncate() resides in ldiskfs layer instead of moving upto OSD layer? - LU-10048 <https://review.whamcloud.com/c/fs/lustre-release/+/27488> claims to "avoids restarting truncate transaction handles in main transaction", while in osd_fallocate_preallocate() it seems there's no such concern? Besides, why should we avoid restarting? Correct me if I misunderstood the code above...Thank you for your input. Best Regards, kg.xu _______________________________________________ lustre-devel mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org