aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--security/selinux/selinuxfs.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index e9552462d16b..cf1acde778de 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -1293,7 +1293,8 @@ out:
1293 return ret; 1293 return ret;
1294} 1294}
1295 1295
1296static int sel_make_dir(struct inode *dir, struct dentry *dentry) 1296static int sel_make_dir(struct inode *dir, struct dentry *dentry,
1297 unsigned long *ino)
1297{ 1298{
1298 int ret = 0; 1299 int ret = 0;
1299 struct inode *inode; 1300 struct inode *inode;
@@ -1305,7 +1306,7 @@ static int sel_make_dir(struct inode *dir, struct dentry *dentry)
1305 } 1306 }
1306 inode->i_op = &simple_dir_inode_operations; 1307 inode->i_op = &simple_dir_inode_operations;
1307 inode->i_fop = &simple_dir_operations; 1308 inode->i_fop = &simple_dir_operations;
1308 inode->i_ino = ++sel_last_ino; 1309 inode->i_ino = ++(*ino);
1309 /* directory inodes start off with i_nlink == 2 (for "." entry) */ 1310 /* directory inodes start off with i_nlink == 2 (for "." entry) */
1310 inc_nlink(inode); 1311 inc_nlink(inode);
1311 d_add(dentry, inode); 1312 d_add(dentry, inode);
@@ -1351,7 +1352,7 @@ static int sel_fill_super(struct super_block * sb, void * data, int silent)
1351 goto err; 1352 goto err;
1352 } 1353 }
1353 1354
1354 ret = sel_make_dir(root_inode, dentry); 1355 ret = sel_make_dir(root_inode, dentry, &sel_last_ino);
1355 if (ret) 1356 if (ret)
1356 goto err; 1357 goto err;
1357 1358
@@ -1384,7 +1385,7 @@ static int sel_fill_super(struct super_block * sb, void * data, int silent)
1384 goto err; 1385 goto err;
1385 } 1386 }
1386 1387
1387 ret = sel_make_dir(root_inode, dentry); 1388 ret = sel_make_dir(root_inode, dentry, &sel_last_ino);
1388 if (ret) 1389 if (ret)
1389 goto err; 1390 goto err;
1390 1391
@@ -1398,7 +1399,7 @@ static int sel_fill_super(struct super_block * sb, void * data, int silent)
1398 goto err; 1399 goto err;
1399 } 1400 }
1400 1401
1401 ret = sel_make_dir(root_inode, dentry); 1402 ret = sel_make_dir(root_inode, dentry, &sel_last_ino);
1402 if (ret) 1403 if (ret)
1403 goto err; 1404 goto err;
1404 1405