From cb828499b9e7d94abacc0aa78a67f4b8e5234ace Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Thu, 16 Oct 2008 14:15:16 +1100 Subject: [PATCH] --- yaml --- r: 116234 b: refs/heads/master c: 504e518953a330c8d44a95bdd65a5c9f50f1012e h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/nfs/nfs4proc.c | 6 ++++-- trunk/include/linux/nfs_fs.h | 8 ++++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index b1a7faf93d37..0b6c861ad9cc 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 18de9735300756e3ca9c361ef58409d8561dfe0d +refs/heads/master: 504e518953a330c8d44a95bdd65a5c9f50f1012e diff --git a/trunk/fs/nfs/nfs4proc.c b/trunk/fs/nfs/nfs4proc.c index c910413eaeca..83e700a2b0c0 100644 --- a/trunk/fs/nfs/nfs4proc.c +++ b/trunk/fs/nfs/nfs4proc.c @@ -1659,8 +1659,10 @@ nfs4_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr, struct nfs_open_context *ctx; ctx = nfs_file_open_context(sattr->ia_file); - cred = ctx->cred; - state = ctx->state; + if (ctx) { + cred = ctx->cred; + state = ctx->state; + } } status = nfs4_do_setattr(inode, cred, fattr, sattr, state); diff --git a/trunk/include/linux/nfs_fs.h b/trunk/include/linux/nfs_fs.h index ac8d0233b05c..4eaa8347a0d9 100644 --- a/trunk/include/linux/nfs_fs.h +++ b/trunk/include/linux/nfs_fs.h @@ -367,8 +367,12 @@ static inline struct nfs_open_context *nfs_file_open_context(struct file *filp) static inline struct rpc_cred *nfs_file_cred(struct file *file) { - if (file != NULL) - return nfs_file_open_context(file)->cred; + if (file != NULL) { + struct nfs_open_context *ctx = + nfs_file_open_context(file); + if (ctx) + return ctx->cred; + } return NULL; }