[XFS] Fix symlink creation too, with respect to initialising SELinux context.

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

Signed-off-by: Nathan Scott <nathans@sgi.com>

+8 -5
+8 -5
fs/xfs/linux-2.6/xfs_iops.c
··· 474 475 error = 0; 476 VOP_SYMLINK(dvp, dentry, &va, (char *)symname, &cvp, NULL, error); 477 - if (!error && cvp) { 478 - ip = LINVFS_GET_IP(cvp); 479 - d_instantiate(dentry, ip); 480 - validate_fields(dir); 481 - validate_fields(ip); /* size needs update */ 482 } 483 return -error; 484 }
··· 474 475 error = 0; 476 VOP_SYMLINK(dvp, dentry, &va, (char *)symname, &cvp, NULL, error); 477 + if (likely(!error && cvp)) { 478 + error = linvfs_init_security(cvp, dir); 479 + if (likely(!error)) { 480 + ip = LINVFS_GET_IP(cvp); 481 + d_instantiate(dentry, ip); 482 + validate_fields(dir); 483 + validate_fields(ip); 484 + } 485 } 486 return -error; 487 }