diff options
author | Christoph Hellwig <hch@infradead.org> | 2010-10-31 08:35:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-31 09:35:15 -0400 |
commit | 51ee4b84f5c86935b438d6636f34b523edb415a8 (patch) | |
tree | c60e0da8f8b6393477d79ef6d6ce321ee3b8ecaa /fs/cifs/cifsfs.c | |
parent | 96f935934591b72f5b05fd6923bc8cdcae92f2e5 (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/cifs/cifsfs.c')
-rw-r--r-- | fs/cifs/cifsfs.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 54745b6c3db9..75c4eaa79588 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -625,11 +625,8 @@ static int cifs_setlease(struct file *file, long arg, struct file_lock **lease) | |||
625 | knows that the file won't be changed on the server | 625 | knows that the file won't be changed on the server |
626 | by anyone else */ | 626 | by anyone else */ |
627 | return generic_setlease(file, arg, lease); | 627 | return generic_setlease(file, arg, lease); |
628 | else { | 628 | else |
629 | if (arg != F_UNLCK) | ||
630 | locks_free_lock(*lease); | ||
631 | return -EAGAIN; | 629 | return -EAGAIN; |
632 | } | ||
633 | } | 630 | } |
634 | 631 | ||
635 | struct file_system_type cifs_fs_type = { | 632 | struct file_system_type cifs_fs_type = { |