]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.25/patches.fixes/nfs-file-cred-context-null
Updated xen patches taken from suse.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.fixes / nfs-file-cred-context-null
CommitLineData
00e5a55c
BS
1From: NeilBrown <neilb@suse.de>
2Subject: nfs_file_cred should cope if 'file' hasn't been opened properly
3Patch-mainline: Not relevant
4References: bnc#431785
5
6
7.. and so doesn't have a 'context'. This can happen when e.g.
8a chmod on a device-special-file happens. The object isn't opened over
9NFS so there is no open context, but we currently look for one when
10doing a setattr.
11
12Signed-off-by: Neil Brown <neilb@suse.de>
13
14---
15 include/linux/nfs_fs.h | 7 +++++--
16 1 file changed, 5 insertions(+), 2 deletions(-)
17
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
21
22 static inline struct rpc_cred *nfs_file_cred(struct file *file)
23 {
24- if (file != NULL)
25- return nfs_file_open_context(file)->cred;
26+ if (file != NULL) {
27+ struct nfs_open_context *ctx = nfs_file_open_context(file);
28+ if (ctx)
29+ return ctx->cred;
30+ }
31 return NULL;
32 }
33