ocfs2/xattr: assign errno to 'ret' in ocfs2_calc_xattr_init()
authorpiaojun <piaojun@huawei.com>
Thu, 1 Feb 2018 00:14:51 +0000 (16:14 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 1 Feb 2018 01:18:35 +0000 (17:18 -0800)
We need catch the errno returned by ocfs2_xattr_get_nolock() and assign
it to 'ret' for printing and noticing upper callers.

Link: http://lkml.kernel.org/r/5A571CAF.8050709@huawei.com
Signed-off-by: Jun Piao <piaojun@huawei.com>
Reviewed-by: Alex Chen <alex.chen@huawei.com>
Reviewed-by: Yiwen Jiang <jiangyiwen@huawei.com>
Acked-by: Gang He <ghe@suse.com>
Acked-by: Changwei Ge <ge.changwei@h3c.com>
Cc: Mark Fasheh <mfasheh@versity.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Joseph Qi <jiangqi903@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ocfs2/xattr.c

index 2423e905ec1a60e05888e3d37a5ca3fee128c6ad..268619c96b4e02da3e9e1b5147adb69f8b0a4c79 100644 (file)
@@ -646,6 +646,7 @@ int ocfs2_calc_xattr_init(struct inode *dir,
                        if (S_ISDIR(mode))
                                a_size <<= 1;
                } else if (acl_len != 0 && acl_len != -ENODATA) {
+                       ret = acl_len;
                        mlog_errno(ret);
                        return ret;
                }