aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4state.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 579f7fea7968..75e8b137580c 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -190,7 +190,8 @@ nfs4_close_delegation(struct nfs4_delegation *dp)
190 dp->dl_vfs_file = NULL; 190 dp->dl_vfs_file = NULL;
191 /* The following nfsd_close may not actually close the file, 191 /* The following nfsd_close may not actually close the file,
192 * but we want to remove the lease in any case. */ 192 * but we want to remove the lease in any case. */
193 setlease(filp, F_UNLCK, &dp->dl_flock); 193 if (dp->dl_flock)
194 setlease(filp, F_UNLCK, &dp->dl_flock);
194 nfsd_close(filp); 195 nfsd_close(filp);
195 vfsclose++; 196 vfsclose++;
196} 197}
@@ -1673,10 +1674,7 @@ nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open, struct nfs4_sta
1673 if ((status = setlease(stp->st_vfs_file, 1674 if ((status = setlease(stp->st_vfs_file,
1674 flag == NFS4_OPEN_DELEGATE_READ? F_RDLCK: F_WRLCK, &flp))) { 1675 flag == NFS4_OPEN_DELEGATE_READ? F_RDLCK: F_WRLCK, &flp))) {
1675 dprintk("NFSD: setlease failed [%d], no delegation\n", status); 1676 dprintk("NFSD: setlease failed [%d], no delegation\n", status);
1676 list_del(&dp->dl_del_perfile); 1677 unhash_delegation(dp);
1677 list_del(&dp->dl_del_perclnt);
1678 nfs4_put_delegation(dp);
1679 free_delegation++;
1680 flag = NFS4_OPEN_DELEGATE_NONE; 1678 flag = NFS4_OPEN_DELEGATE_NONE;
1681 goto out; 1679 goto out;
1682 } 1680 }