]> git.baikalelectronics.ru Git - kernel.git/commit
nfs: use file_dentry()
authorMiklos Szeredi <mszeredi@redhat.com>
Sat, 26 Mar 2016 20:14:39 +0000 (16:14 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 26 Mar 2016 20:14:39 +0000 (16:14 -0400)
commitbe33ea31ec6c57b0fc14fc037083482eee9ac0d1
tree45c57ddc7b03dde0d4262af9f6c91ec5f5a74648
parent1deac51b865a2ab3e5c40746211bead280bc87db
nfs: use file_dentry()

NFS may be used as lower layer of overlayfs and accessing f_path.dentry can
lead to a crash.

Fix by replacing direct access of file->f_path.dentry with the
file_dentry() accessor, which will always return a native object.

Fixes: 16642b5d2b95 ("overlayfs: Make f_path always point to the overlay and f_inode to the underlay")
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Tested-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Acked-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: <stable@vger.kernel.org> # v4.2
Cc: David Howells <dhowells@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
fs/nfs/dir.c
fs/nfs/inode.c
fs/nfs/nfs4file.c