Re: races in ll_splice_alias()

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

 



On Wed, Mar 09, 2016 at 12:53:20AM +0000, Drokin, Oleg wrote:

> I have not tried this exact one yet (will try in a moment).
> But it appears we do need ll_d_init() call if we got a hit
> in d_exact_alias().
> A particular test case fails due to lack of the d_fsdata being null.

Very interesting.  I'd suggest checking if we hit that d_instantiate()
in your namei.c with NULL ->d_fsdata.  That really shouldn't happen, AFAICS...


> @@ -374,9 +368,9 @@ struct dentry *ll_splice_alias(struct inode *inode, struct dentry *de)
>  		}
>  	}
>  	rc = ll_d_init(de);
> +	d_add(de, inode);
>  	if (rc < 0)
>  		return ERR_PTR(rc);
> -	d_add(de, inode);

Uhh...  Why would you reorder them like that?

> Also any particular reason to prefer d_splice_alias over d_add? Did not we already determine there
> were no other aliases.

No unhashed aliases with the same name and parent.  Seriously, d_splice_alias()
will do exactly the same thing as d_add() except for the situations where
d_add() would've created multiple dentries over the same directory inode.
And it's not more costly outside of that case...
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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