From: Nathan Scott Date: Mon, 16 Jan 2006 04:54:05 +0000 (+1100) Subject: [XFS] Fix symlink creation too, with respect to initialising SELinux X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=54245702ab63a9a0b1ccf78bc37b57e778bb3bcc;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [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 --- diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index 4bd3d03b23e..521bf3834b4 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c @@ -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; }