From: Theodore Ts'o Date: Fri, 24 Mar 2006 03:37:02 +0000 (-0500) Subject: mklost+found: Create full-sized a lost+found directory with 4k+ blocksizes X-Git-Tag: E2FSPROGS-1.39-WIP-0330~16 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=fcadc8c84cf0a390ab8a41ff620bb31630b5e0a9;p=tools%2Fe2fsprogs.git mklost+found: Create full-sized a lost+found directory with 4k+ blocksizes Fixed a bug caused by using an insufficiently larger counter field so that mklost+found would work properly on filesystems with larger block sizes. Signed-off-by: "Theodore Ts'o" --- diff --git a/misc/ChangeLog b/misc/ChangeLog index 11ab927..421498d 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,5 +1,9 @@ 2006-03-23 Theodore Ts'o + * mklost+found.c (main): Use a larger counter field so that we can + create enough directory entries that we can make a full + lost+found directory with larger block sizes. + * mke2fs.conf, mke2fs.conf.5.in: New configuration file which when installed, provides mke2fs's old behaviour. It makes it easier for distributions to change which filesystem diff --git a/misc/mklost+found.c b/misc/mklost+found.c index 027c899..a0e71f0 100644 --- a/misc/mklost+found.c +++ b/misc/mklost+found.c @@ -55,9 +55,9 @@ int main (int argc, char ** argv) } i = 0; - memset (name, 'x', 252); + memset (name, 'x', 246); do { - sprintf (name + 252, "%02d", i); + sprintf (name + 246, "%08d", i); strcpy (path, LPF); strcat (path, "/"); strcat (path, name); @@ -73,7 +73,7 @@ int main (int argc, char ** argv) } } while (st.st_size <= (EXT2_NDIR_BLOCKS - 1) * st.st_blksize); for (j = 0; j < i; j++) { - sprintf (name + 252, "%02d", j); + sprintf (name + 246, "%08d", j); strcpy (path, LPF); strcat (path, "/"); strcat (path, name);