summaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-10-31 13:35:10 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-31 14:35:15 +0100
commit51ee4b84f5c86935b438d6636f34b523edb415a8 (patch)
treec60e0da8f8b6393477d79ef6d6ce321ee3b8ecaa /fs/nfsd
parentinitramfs: Fix initramfs size for 32-bit arches (diff)
downloadlinux-51ee4b84f5c86935b438d6636f34b523edb415a8.tar.xz
linux-51ee4b84f5c86935b438d6636f34b523edb415a8.zip
locks: let the caller free file_lock on ->setlease failure
The caller allocated it, the caller should free it. The only issue so far is that we could change the flp pointer even on an error return if the fl_change callback failed. But we can simply move the flp assignment after the fl_change invocation, as the callers don't care about the flp return value if the setlease call failed. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4state.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index b7f818b0580c..f1e5ec6b5105 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2652,6 +2652,7 @@ nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open, struct nfs4_sta
if ((status = vfs_setlease(fl->fl_file, fl->fl_type, &fl))) {
dprintk("NFSD: setlease failed [%d], no delegation\n", status);
dp->dl_flock = NULL;
+ locks_free_lock(fl);
unhash_delegation(dp);
flag = NFS4_OPEN_DELEGATE_NONE;
goto out;