]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[XFS] Catch errors from xfs_acl_setmode().
authorDavid Chinner <dgc@sgi.com>
Thu, 10 Apr 2008 02:20:58 +0000 (12:20 +1000)
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>
Fri, 18 Apr 2008 01:57:46 +0000 (11:57 +1000)
Propagate the error status from xfs_acl_setmode() so that callers know if
the ACl was set correctly or not.

SGI-PV: 980084
SGI-Modid: xfs-linux-melb:xfs-kern:30792a

Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
fs/xfs/xfs_acl.c

index 7272fe39a92de3c1007999e14ffb310a933654f0..98b515d39187f892b71c1b289447c45e3d266bb2 100644 (file)
@@ -307,12 +307,13 @@ xfs_acl_vset(
 
        VN_HOLD(vp);
        error = xfs_acl_allow_set(vp, kind);
-       if (error)
-               goto out;
 
        /* Incoming ACL exists, set file mode based on its value */
-       if (kind == _ACL_TYPE_ACCESS)
-               xfs_acl_setmode(vp, xfs_acl, &basicperms);
+       if (!error && kind == _ACL_TYPE_ACCESS)
+               error = xfs_acl_setmode(vp, xfs_acl, &basicperms);
+
+       if (error)
+               goto out;
 
        /*
         * If we have more than std unix permissions, set up the actual attr.
@@ -707,7 +708,9 @@ xfs_acl_inherit(
 
        memcpy(cacl, pdaclp, sizeof(xfs_acl_t));
        xfs_acl_filter_mode(mode, cacl);
-       xfs_acl_setmode(vp, cacl, &basicperms);
+       error = xfs_acl_setmode(vp, cacl, &basicperms);
+       if (error)
+               goto out_error;
 
        /*
         * Set the Default and Access ACL on the file.  The mode is already
@@ -720,6 +723,7 @@ xfs_acl_inherit(
                xfs_acl_set_attr(vp, pdaclp, _ACL_TYPE_DEFAULT, &error);
        if (!error && !basicperms)
                xfs_acl_set_attr(vp, cacl, _ACL_TYPE_ACCESS, &error);
+out_error:
        _ACL_FREE(cacl);
        return error;
 }