ceph: return errors from posix_acl_equiv_mode() correctly
authorChengguang Xu <cgxu519@gmx.com>
Mon, 9 Jul 2018 14:48:07 +0000 (22:48 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 2 Aug 2018 19:26:12 +0000 (21:26 +0200)
In order to return correct error code should replace variable ret
using err in error case.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/acl.c

index 3351ea1..027408d 100644 (file)
@@ -185,10 +185,10 @@ int ceph_pre_init_acls(struct inode *dir, umode_t *mode,
                return err;
 
        if (acl) {
-               int ret = posix_acl_equiv_mode(acl, mode);
-               if (ret < 0)
+               err = posix_acl_equiv_mode(acl, mode);
+               if (err < 0)
                        goto out_err;
-               if (ret == 0) {
+               if (err == 0) {
                        posix_acl_release(acl);
                        acl = NULL;
                }