Skip to content

Commit 4b75de8

Browse files
committed
fs: Set the size of empty dirs to 0.
Before the make_empty_dir_inode calls were introduce into proc, sysfs, and sysctl those directories when stated reported an i_size of 0. make_empty_dir_inode started reporting an i_size of 2. At least one userspace application depended on stat returning i_size of 0. So modify make_empty_dir_inode to cause an i_size of 0 to be reported for these directories. Cc: [email protected] Reported-by: Tejun Heo <[email protected]> Acked-by: Tejun Heo <[email protected]> Signed-off-by: "Eric W. Biederman" <[email protected]>
1 parent faf00da commit 4b75de8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/libfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ void make_empty_dir_inode(struct inode *inode)
11851185
inode->i_uid = GLOBAL_ROOT_UID;
11861186
inode->i_gid = GLOBAL_ROOT_GID;
11871187
inode->i_rdev = 0;
1188-
inode->i_size = 2;
1188+
inode->i_size = 0;
11891189
inode->i_blkbits = PAGE_SHIFT;
11901190
inode->i_blocks = 0;
11911191

0 commit comments

Comments
 (0)