diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-06-17 18:13:00 -0700 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-06-18 18:13:44 -0700 |
commit | 1f84603c0940d5bed17f7e4d2e0b2a4b8b8f1b81 (patch) | |
tree | 143956f878290e85de7c9130f465e862f587ee53 /fs/nfs/delegation.c | |
parent | 301933a0acfdec837fd8b4884093b3f0fff01d8a (diff) | |
parent | 4bf259e3ae5015e73282ba66716c4a917e1264ac (diff) | |
download | kernel-crypto-1f84603c0940d5bed17f7e4d2e0b2a4b8b8f1b81.tar.gz kernel-crypto-1f84603c0940d5bed17f7e4d2e0b2a4b8b8f1b81.tar.xz kernel-crypto-1f84603c0940d5bed17f7e4d2e0b2a4b8b8f1b81.zip |
Merge branch 'devel-for-2.6.31' into for-2.6.31
Conflicts:
fs/nfs/client.c
fs/nfs/super.c
Diffstat (limited to 'fs/nfs/delegation.c')
-rw-r--r-- | fs/nfs/delegation.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index 968225a8801..af05b918cb5 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c @@ -68,29 +68,26 @@ static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_ { struct inode *inode = state->inode; struct file_lock *fl; - int status; + int status = 0; + + if (inode->i_flock == NULL) + goto out; + /* Protect inode->i_flock using the BKL */ + lock_kernel(); for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) { if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK))) continue; if (nfs_file_open_context(fl->fl_file) != ctx) continue; + unlock_kernel(); status = nfs4_lock_delegation_recall(state, fl); - if (status >= 0) - continue; - switch (status) { - default: - printk(KERN_ERR "%s: unhandled error %d.\n", - __func__, status); - case -NFS4ERR_EXPIRED: - /* kill_proc(fl->fl_pid, SIGLOST, 1); */ - case -NFS4ERR_STALE_CLIENTID: - nfs4_schedule_state_recovery(NFS_SERVER(inode)->nfs_client); - goto out_err; - } + if (status < 0) + goto out; + lock_kernel(); } - return 0; -out_err: + unlock_kernel(); +out: return status; } @@ -268,7 +265,10 @@ static int __nfs_inode_return_delegation(struct inode *inode, struct nfs_delegat struct nfs_inode *nfsi = NFS_I(inode); nfs_msync_inode(inode); - /* Guard against new delegated open calls */ + /* + * Guard against new delegated open/lock/unlock calls and against + * state recovery + */ down_write(&nfsi->rwsem); nfs_delegation_claim_opens(inode, &delegation->stateid); up_write(&nfsi->rwsem); |