From 076fa3d64f34ebddb4aa3abd2257af7dd82b1c99 Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Thu, 23 Sep 2010 12:22:09 -0400 Subject: [PATCH] --- yaml --- r: 217054 b: refs/heads/master c: ef84303ebc77a9041265faaccd56b7fcef151077 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/nfs/inode.c | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 7abe74f56931..54ede9b20514 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5eebde23223aeb0ad2d9e3be6590ff8bbfab0fc2 +refs/heads/master: ef84303ebc77a9041265faaccd56b7fcef151077 diff --git a/trunk/fs/nfs/inode.c b/trunk/fs/nfs/inode.c index 2ff814272dcf..702ed096e790 100644 --- a/trunk/fs/nfs/inode.c +++ b/trunk/fs/nfs/inode.c @@ -654,11 +654,14 @@ static void __put_nfs_open_context(struct nfs_open_context *ctx, int is_sync) { struct inode *inode = ctx->path.dentry->d_inode; - if (!atomic_dec_and_lock(&ctx->lock_context.count, &inode->i_lock)) + if (inode) { + if (!atomic_dec_and_lock(&ctx->lock_context.count, &inode->i_lock)) + return; + list_del(&ctx->list); + spin_unlock(&inode->i_lock); + NFS_PROTO(inode)->close_context(ctx, is_sync); + } else if (!atomic_dec_and_test(&ctx->lock_context.count)) return; - list_del(&ctx->list); - spin_unlock(&inode->i_lock); - NFS_PROTO(inode)->close_context(ctx, is_sync); if (ctx->cred != NULL) put_rpccred(ctx->cred); path_put(&ctx->path);