1 From: NeilBrown <neilb@suse.de>
2 Subject: nfs_file_cred should cope if 'file' hasn't been opened properly
3 Patch-mainline: Not relevant
7 .. and so doesn't have a 'context'. This can happen when e.g.
8 a chmod on a device-special-file happens. The object isn't opened over
9 NFS so there is no open context, but we currently look for one when
12 Signed-off-by: Neil Brown <neilb@suse.de>
15 include/linux/nfs_fs.h | 7 +++++--
16 1 file changed, 5 insertions(+), 2 deletions(-)
18 --- linux-2.6.27-neilb.orig/include/linux/nfs_fs.h
19 +++ linux-2.6.27-neilb/include/linux/nfs_fs.h
20 @@ -372,8 +372,11 @@ static inline struct nfs_open_context *n
22 static inline struct rpc_cred *nfs_file_cred(struct file *file)
25 - return nfs_file_open_context(file)->cred;
27 + struct nfs_open_context *ctx = nfs_file_open_context(file);