aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/file.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-10-31 08:35:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-31 09:35:15 -0400
commit51ee4b84f5c86935b438d6636f34b523edb415a8 (patch)
treec60e0da8f8b6393477d79ef6d6ce321ee3b8ecaa /fs/nfs/file.c
parent96f935934591b72f5b05fd6923bc8cdcae92f2e5 (diff)
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/nfs/file.c')
-rw-r--r--fs/nfs/file.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 1e524fb73ba5..60677f9f1311 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -884,7 +884,5 @@ static int nfs_setlease(struct file *file, long arg, struct file_lock **fl)
884 dprintk("NFS: setlease(%s/%s, arg=%ld)\n", 884 dprintk("NFS: setlease(%s/%s, arg=%ld)\n",
885 file->f_path.dentry->d_parent->d_name.name, 885 file->f_path.dentry->d_parent->d_name.name,
886 file->f_path.dentry->d_name.name, arg); 886 file->f_path.dentry->d_name.name, arg);
887 if (arg != F_UNLCK)
888 locks_free_lock(*fl);
889 return -EINVAL; 887 return -EINVAL;
890} 888}