瀏覽代碼

[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>

Nathan Scott 19 年之前
父節點
當前提交
54245702ab
共有 1 個文件被更改,包括 8 次插入5 次删除
  1. 8 5
      fs/xfs/linux-2.6/xfs_iops.c

+ 8 - 5
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;
 }