]> git.baikalelectronics.ru Git - kernel.git/commit
fuse: readdirplus: fix RCU walk
authorMiklos Szeredi <mszeredi@suse.cz>
Tue, 1 Oct 2013 14:41:22 +0000 (16:41 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Tue, 1 Oct 2013 14:41:22 +0000 (16:41 +0200)
commit8145f968e8264e2a115c2fce06ff7654afda3001
tree1a891d7590e5f036526fa304e1a8f710185858a2
parente6196f7d413aa206f91d44bd0d3f268d019b337b
fuse: readdirplus: fix RCU walk

Doing dput(parent) is not valid in RCU walk mode.  In RCU mode it would
probably be okay to update the parent flags, but it's actually not
necessary most of the time...

So only set the FUSE_I_ADVISE_RDPLUS flag on the parent when the entry was
recently initialized by READDIRPLUS.

This is achieved by setting FUSE_I_INIT_RDPLUS on entries added by
READDIRPLUS and only dropping out of RCU mode if this flag is set.
FUSE_I_INIT_RDPLUS is cleared once the FUSE_I_ADVISE_RDPLUS flag is set in
the parent.

Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: stable@vger.kernel.org
fs/fuse/dir.c
fs/fuse/fuse_i.h