Re: [PATCHSET v2] ->follow_link() without dropping from RCU mode

From: Al Viro
Date: Wed Dec 09 2015 - 13:23:16 EST


On Wed, Dec 09, 2015 at 09:24:32AM -0800, Linus Torvalds wrote:

> That's because of the HIGHMEM crap that you removed. Without
> highmem, the page data address specifies the page fine without any
> cookie.
>
> - overlayfs, which uses it to create a temporary data storage.
>
> Why? Mainly because it wants to hide the cookie in there. D'oh!

Not really - it also wants to stash a way to underlying inode in there.
See below...

> - proc, which uses it to save the proc_dir_entry
>
> Why? The reason seems to be that we don't call put_link() with the
> dentry that get_link got, so it can't look it up the sane way.

What's more, that dentry might very well have gone negative by that
point. Think what happens if, during the symlink traversal, we run
into the hard "restart from scratch in non-RCU mode". We'll need to
do ->put_link() on everything we have in stack. Regardless of what
might've happened to dentries/inodes of symlinks involved - all we
are really promised is that RCU-delayed parts of their destruction hadn't
been entered yet.

Note, BTW, that *all* ->put_link() instances ignore the inode argument
and I seriously considered dropping it completely.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/