[XFS] Fix symlink creation too, with respect to initialising SELinux
authorNathan Scott <nathans@sgi.com>
Mon, 16 Jan 2006 04:54:05 +0000 (15:54 +1100)
committerNathan Scott <nathans@sgi.com>
Mon, 16 Jan 2006 04:54:05 +0000 (15:54 +1100)
context.

SGI-PV: 946762
SGI-Modid: xfs-linux-melb:xfs-kern:24983a

Signed-off-by: Nathan Scott <nathans@sgi.com>
fs/xfs/linux-2.6/xfs_iops.c

index 4bd3d03b23edf6c0ba22bda785336ad0a2e54268..521bf3834b4326a15e33ecd23fed9e73ba154000 100644 (file)
@@ -474,11 +474,14 @@ linvfs_symlink(
 
        error = 0;
        VOP_SYMLINK(dvp, dentry, &va, (char *)symname, &cvp, NULL, error);
-       if (!error && cvp) {
-               ip = LINVFS_GET_IP(cvp);
-               d_instantiate(dentry, ip);
-               validate_fields(dir);
-               validate_fields(ip); /* size needs update */
+       if (likely(!error && cvp)) {
+               error = linvfs_init_security(cvp, dir);
+               if (likely(!error)) {
+                       ip = LINVFS_GET_IP(cvp);
+                       d_instantiate(dentry, ip);
+                       validate_fields(dir);
+                       validate_fields(ip);
+               }
        }
        return -error;
 }