switch fallocate(2) to fget_light()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 27 Aug 2012 00:15:40 +0000 (20:15 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 27 Sep 2012 01:10:03 +0000 (21:10 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/open.c

index 9f61d7269d39ff6e5bf67450aea4940405ef0aad..da6d3f1ac243d8f93f114224876b36fcbc310557 100644 (file)
--- a/fs/open.c
+++ b/fs/open.c
@@ -277,12 +277,12 @@ int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
 SYSCALL_DEFINE(fallocate)(int fd, int mode, loff_t offset, loff_t len)
 {
        struct file *file;
-       int error = -EBADF;
+       int error = -EBADF, fput_needed;
 
-       file = fget(fd);
+       file = fget_light(fd, &fput_needed);
        if (file) {
                error = do_fallocate(file, mode, offset, len);
-               fput(file);
+               fput_light(file, fput_needed);
        }
 
        return error;