Whamcloud - gitweb
LU-1502 mke2fs: don't set uid/gid for root 19/6419/2
authorNiu Yawei <yawei.niu@intel.com>
Thu, 19 Sep 2013 10:57:22 +0000 (06:57 -0400)
committerNiu Yawei <yawei.niu@intel.com>
Thu, 19 Sep 2013 11:01:39 +0000 (07:01 -0400)
Don't set uid/gid for root directory when mkfs.
The expect.1 of m_quota is updated accordingly.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Signed-off-by: Vladimir Saveliev <vladimir_saveliev@xyratex.com>
Change-Id: I034d9fa68b252b555472d09eb48439a8e78ed342

misc/mke2fs.c
tests/m_quota/expect.1

index 3ba073c..05b2d5e 100644 (file)
@@ -364,28 +364,6 @@ static void create_root_dir(ext2_filsys fs)
                com_err("ext2fs_mkdir", retval, _("while creating root dir"));
                exit(1);
        }
-       if (geteuid()) {
-               retval = ext2fs_read_inode(fs, EXT2_ROOT_INO, &inode);
-               if (retval) {
-                       com_err("ext2fs_read_inode", retval,
-                               _("while reading root inode"));
-                       exit(1);
-               }
-               uid = getuid();
-               inode.i_uid = uid;
-               ext2fs_set_i_uid_high(inode, uid >> 16);
-               if (uid) {
-                       gid = getgid();
-                       inode.i_gid = gid;
-                       ext2fs_set_i_gid_high(inode, gid >> 16);
-               }
-               retval = ext2fs_write_new_inode(fs, EXT2_ROOT_INO, &inode);
-               if (retval) {
-                       com_err("ext2fs_write_inode", retval,
-                               _("while setting root inode ownership"));
-                       exit(1);
-               }
-       }
 }
 
 static void create_lost_and_found(ext2_filsys fs)
index f1591b8..1c86f59 100644 (file)
@@ -24,7 +24,7 @@ Pass 2: Checking directory structure
 Pass 3: Checking directory connectivity
 Pass 4: Checking reference counts
 Pass 5: Checking group summary information
-test_filesys: 11/32768 files (18.2% non-contiguous), 5709/131072 blocks
+test_filesys: 11/32768 files (18.2% non-contiguous), 5703/131072 blocks
 Exit status is 0
 
 Filesystem volume name:   <none>
@@ -39,7 +39,7 @@ Filesystem OS type:       Linux
 Inode count:              32768
 Block count:              131072
 Reserved block count:     6553
-Free blocks:              125363
+Free blocks:              125369
 Free inodes:              32757
 First block:              1
 Block size:               1024
@@ -65,8 +65,8 @@ Group 0: (Blocks 1-8192)
   Reserved GDT blocks at 3-258
   Block bitmap at 259 (+258), Inode bitmap at 260 (+259)
   Inode table at 261-516 (+260)
-  7644 free blocks, 2037 free inodes, 2 directories
-  Free blocks: 549-8192
+  7650 free blocks, 2037 free inodes, 2 directories
+  Free blocks: 543-8192
   Free inodes: 12-2048
 Group 1: (Blocks 8193-16384)
   Backup superblock at 8193, Group descriptors at 8194-8194