Question: d_revalidate in rcu-walk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sorry for the noise, the original email was rejected by linux-fsdevel server since I forget to send
it in plain text mode :(

At 2016-09-03 18:46:05, "shyodx1989" <shyodx1989@xxxxxxx> wrote:
Hi, folks,

When I read rcu-walk code, I'm confused about the scenario of returning -ECHILD in d_revalidate
of local filesystem. path-walk.txt says that "inode is also RCU protected so we can load d_inode
and use the inode for limited things", and i_mode, i_uid, i_gid and i_op can be tested or loaded.

But most filesystems, which have d_revalidate, return -ECHILD if LOOKUP_RCU is set instead of
checking if it is safe for rcu-walk. However commit 5c0f360b083fb33d05d1bff4b138b82d715eb419
"jfs_ci_revalidate() is safe from RCU mode" removes the check. So why is jfs_ci_revalidate safe in
RCU  mode and if we only check d_inode (like the following code), what should we care about to
tell if d_revalidate is safe for rcu-walk or not and? Ref-walk is much slower than rcu-walk, maybe
it's better not to return -ECHILD directly if not necessary.

d_revalidate(dentry, flags)
{
        if (flags & LOOKUP_RCU)
                return -ECHILD
        if (!d_inode_rcu(dentry))
                return 0;
        return 1;
}

thanks,
Sheng��.n��������+%������w��{.n�����{���)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux