lkml.org 
[lkml]   [2021]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH RFC 1/3] fs: introduce helper d_path_fast()
    On Sat, May 8, 2021 at 2:06 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
    >
    > FWIW, if we go that way, I would make that
    >
    > while (dentry != root->dentry || &mnt->mnt != root->mnt) {
    > int error;
    > struct dentry *parent = READ_ONCE(dentry->d_parent);

    Side note: you've added that READ_ONCE() to the parent reading, and I
    think that's a bug-fix regardless. The old code does that plain

    parent = dentry->d_parent;

    (after doing the mountpoint stuff). And d_parent isn't actually
    guaranteed stable here.

    It probably does not matter - we are in a RCU read-locked section, so
    it's not like parent will go away, but in theory we might end up with
    (for example) pre-fetching a different parent than the one we then
    walk down.

    But your READ_ONCE() is definitely the right thing to do (whether we
    do your re-org or not, and whether we do this "prepend_buffer" thing
    or not).

    Do you want to do a final version with your fixes?

    Linus

    \
     
     \ /
      Last update: 2021-05-09 00:42    [W:2.264 / U:0.508 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site