[lustre-devel] HELP: difference between fallocate and truncate implementation
arshad hussain
arshad.super at gmail.com
Tue Nov 19 05:04:05 PST 2024
Hi Kg.Xu,
> - 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
When fallocate was first introduced (LU-3606) it did called into
ldiskfs_fallocate(). During LU-13765, it was moved to the OSD layer
with the difference being credits extend (osd_extend_restart_trans()).
These changes could have been done under ldiskfs but it is much more
straightforward and uncomplicated to implement it under OSD. Though it
is not a layering hack.
Thanks,
Arshad
On Tue, Nov 19, 2024 at 2:38 AM <lustre-devel-request at lists.lustre.org> wrote:
>
> Send lustre-devel mailing list submissions to
> lustre-devel at lists.lustre.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
> or, via email, send a message with subject or body 'help' to
> lustre-devel-request at lists.lustre.org
>
> You can reach the person managing the list at
> lustre-devel-owner at lists.lustre.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of lustre-devel digest..."
>
>
> Today's Topics:
>
> 1. HELP: difference between fallocate and truncate
> implementation (keguang xu)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 18 Nov 2024 16:11:38 +0800
> From: keguang xu <squalfof at gmail.com>
> To: lustre-devel at lists.lustre.org
> Subject: [lustre-devel] HELP: difference between fallocate and
> truncate implementation
> Message-ID:
> <CAF83deS+MC_ZKr9vXix_Js63ZyJ2KkXsSwLg5FeBs-+NziYf3Q at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> 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-0001.htm>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> lustre-devel mailing list
> lustre-devel at lists.lustre.org
> http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
>
>
> ------------------------------
>
> End of lustre-devel Digest, Vol 205, Issue 12
> *********************************************
More information about the lustre-devel
mailing list