Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217054
b: refs/heads/master
c: ef84303
h: refs/heads/master
v: v3
  • Loading branch information
Benny Halevy authored and Trond Myklebust committed Sep 23, 2010
1 parent 15411a4 commit 076fa3d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5eebde23223aeb0ad2d9e3be6590ff8bbfab0fc2
refs/heads/master: ef84303ebc77a9041265faaccd56b7fcef151077
11 changes: 7 additions & 4 deletions trunk/fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 076fa3d

Please sign in to comment.