[lustre-devel] HELP: difference between fallocate and truncate implementation

keguang xu squalfof at gmail.com
Mon Nov 18 00:11:38 PST 2024


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lustre.org/pipermail/lustre-devel-lustre.org/attachments/20241118/0c12b8e7/attachment.htm>


More information about the lustre-devel mailing list