ocfs2: fix error return code in ocfs2_info_handle_freefrag()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 29 Apr 2013 22:05:57 +0000 (15:05 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 29 Apr 2013 22:54:27 +0000 (15:54 -0700)
Fix to return a negative error code from the error handling case instead
of 0, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ocfs2/ioctl.c

index 6cab301a568d6a3f15a07de12fa7a43b77759ef2..0c60ef2d8056ea4412e1338a3580f03acc72210a 100644 (file)
@@ -706,8 +706,10 @@ int ocfs2_info_handle_freefrag(struct inode *inode,
 
        o2info_set_request_filled(&oiff->iff_req);
 
-       if (o2info_to_user(*oiff, req))
+       if (o2info_to_user(*oiff, req)) {
+               status = -EFAULT;
                goto bail;
+       }
 
        status = 0;
 bail: