]> git.baikalelectronics.ru Git - kernel.git/commit
fuse: fix readdirplus Oops in fuse_dentry_revalidate
authorMiklos Szeredi <mszeredi@suse.cz>
Mon, 3 Jun 2013 12:40:22 +0000 (14:40 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Mon, 3 Jun 2013 12:40:22 +0000 (14:40 +0200)
commit1619b0fe64c6a5055da971561225c11eb179e193
treeb5a8248227aad4b8fbde6b047257f629283e15dc
parentabfc306478d14b1028c4b66619cabc726285d2c4
fuse: fix readdirplus Oops in fuse_dentry_revalidate

Fix bug introduced by commit 78315f8d0c "FUSE: Adapt readdirplus to application
usage patterns".

We need to check for a positive dentry; negative dentries are not added by
readdirplus.  Secondly we need to advise the use of readdirplus on the *parent*,
otherwise the whole thing is useless.  Thirdly all this is only relevant if
"readdirplus_auto" mode is selected by the filesystem.

We advise the use of readdirplus only if the dentry was still valid.  If we had
to redo the lookup then there was no use in doing the -plus version.

Reported-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
CC: Feng Shuo <steve.shuo.feng@gmail.com>
CC: stable@vger.kernel.org
fs/fuse/dir.c
fs/fuse/inode.c