Skip to contentSkip to conversation

reiserfsprogs patches

PATCH Jeff Mahoney 2 participants 2 messages Aug 17, 2004 Library code

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hey all -

The SuSE copy of reiserfsprogs has a number of patches, mostly backports of fixes. The attached patches are the ones that are fixes, as of 3.6.18, we still apply to our tree and that I feel should be considered for inclusion in the official reiserfsprogs release.

Here's the rundown:
03-cleanly-unmounted
- Just a cosmetic fix to change "cleanly umounted" to "clean" in a few warnings

04-quota_sd_blocks-2
- Fixes fsck incorrectly warning about block counts for symlinks when quotas are enabled

07-auto_quiet.diff
- Makes -a mode run quietly

10-blkgetsiz64.patch
- The BLKGETSIZE64 ioctl was, in earlier kernels, incorrectly prototyped with sizeof (__u64), which expanded to sizeof(sizeof (__u64)) - making it a size_t

Please consider applying.

- -Jeff

- --
Jeff Mahoney
SuSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBIitvLPWxlyuTD7IRAjE7AJ9z2MJB7t8W0hTeIwrBs6+nB7XZSACfatiR HpkOrjjiIUH8qp2g5r3ATCs=
=cn9h
-----END PGP SIGNATURE-----

fsck/main.c +1 -1
Index: reiserfsprogs-3.6.13/fsck/main.c
===================================================================
@@ -883,7 +883,7 @@ static void clean_attributes (reiserfs_f
     time (&t);
 
     if (get_sb_umount_state (fs->fs_ondisk_sb) != FS_CLEANLY_UMOUNTED) {
-        fsck_progress ("Filesystem does not look cleanly umounted\n"
+        fsck_progress ("Filesystem is not clean\n"
 	    "Check consistency of the partition first.\n");
         exit(EXIT_USER);
     }
reiserfscore/prints.c +1 -1
Index: reiserfsprogs-3.6.13/reiserfscore/prints.c
===================================================================
@@ -646,7 +646,7 @@ int print_super_block (FILE * fp, reiser
 		      "bitmaps, data, reserved] blocks): %u\n", get_sb_free_blocks (sb));
 	reiserfs_warning (fp, "Root block: %u\n", get_sb_root_block (sb));
     }
-    reiserfs_warning (fp, "Filesystem marked as %scleanly umounted\n",
+    reiserfs_warning (fp, "Filesystem is %sclean\n",
 		      (get_sb_umount_state (sb) == FS_CLEANLY_UMOUNTED) ? "" : "NOT ");
 
     if (short_print)
fsck/semantic_rebuild.c +2 -1
diff -ur reiserfsprogs-3.6.4/fsck/semantic_rebuild.c reiserfsprogs-3.6.4.suse/fsck/semantic_rebuild.c
@@ -169,7 +169,8 @@
     int ret = 0;
 
     if (S_ISREG (mode) || S_ISLNK (mode) || S_ISDIR (mode)) {
-	if (*blocks != sd_blocks) {
+	if ((!S_ISLNK(mode) && *blocks != sd_blocks) ||
+	    (S_ISLNK(mode) && *blocks != sd_blocks && (ROUND_UP(*blocks) != sd_blocks))) {
 	    fsck_log ("vpf-10680: The %s %K has the wrong block count in the StatData "
 		"(%u)%s(%u)\n", S_ISDIR (mode) ? "directory" : "file",  key, sd_blocks, 
 		fsck_mode(fs) == FSCK_CHECK ? ", should be " : " - corrected to ", *blocks);
fsck/main.c renamed from fsck/main.c.1 +1 -0
@@ -230,6 +230,7 @@
 
 	case 'a':
 	case 'p':
+		data->options |= OPT_QUIET;
 		mode = FSCK_AUTO;
 		break;
 	
lib/misc.c renamed from lib/misc.c.blkgetsiz64 +7 -1
@@ -463,7 +463,13 @@
 }
 
 #if defined(__linux__) && defined(_IOR) && !defined(BLKGETSIZE64)
-#   define BLKGETSIZE64 _IOR(0x12, 114, __u64)
+/* Note! Despite this call being called with *64, it must be encoded to
+ * return only sizeof(size_t), since in earlier kernel versions it was
+ * declared _IOR(0x12, 114, sizeof(u64)), making it use sizeof(sizeof(u64)).
+ *
+ * However, the call itself does always return 64bit!
+ */
+#   define BLKGETSIZE64 _IOR(0x12, 114, size_t)
 #endif
 
 /* To not have problem with last sectors on the block device when switching 
#1 lore raw

Thanks Jeff, Vitaly will review.

Hans

fsck/main.c 2004-03-08 10:40:14.382396213 -0500 static void clean_attributes (reiserfs_f

Quoted 41 lines · Jeff Mahoney

Hey all -

The SuSE copy of reiserfsprogs has a number of patches, mostly backports of fixes. The attached patches are the ones that are fixes, as of 3.6.18, we still apply to our tree and that I feel should be considered for inclusion in the official reiserfsprogs release.

Here's the rundown:
03-cleanly-unmounted
- Just a cosmetic fix to change "cleanly umounted" to "clean" in a few warnings

04-quota_sd_blocks-2
- Fixes fsck incorrectly warning about block counts for symlinks when quotas are enabled

07-auto_quiet.diff
- Makes -a mode run quietly

10-blkgetsiz64.patch
- The BLKGETSIZE64 ioctl was, in earlier kernels, incorrectly prototyped with sizeof (__u64), which expanded to sizeof(sizeof (__u64)) - making it a size_t

Please consider applying.

-Jeff

--
Jeff Mahoney
SuSE Labs

-------------------------

Index: reiserfsprogs-3.6.13/fsck/main.c
===================================================================

fsck/main.c 2004-03-08 10:40:14.382396213 -0500 renamed from fsck/main.c 2004-02-17 07:06:23.000000000 -0500 +0 -0
@@ -883,7 +883,7 @@ static void clean_attributes (reiserfs_f

time (&t);

if (get_sb_umount_state (fs->fs_ondisk_sb) != FS_CLEANLY_UMOUNTED) {

fsck/main.c 2004-03-08 10:40:14.382396213 -0500 static void clean_attributes (reiserfs_f · line 883

Quoted 2 lines
fsck/main.c 2004-03-08 10:40:14.382396213 -0500 renamed from fsck/main.c 2004-02-17 07:06:23.000000000 -0500 +1 -1
-        fsck_progress ("Filesystem does not look cleanly umounted\n"
+        fsck_progress ("Filesystem is not clean\n"
       "Check consistency of the partition first.\n");
       exit(EXIT_USER);

}

reiserfscore/prints.c 2004-03-08 10:41:23.648594772 -0500 int print_super_block (FILE * fp, reiser

Quoted 5 lines

Index: reiserfsprogs-3.6.13/reiserfscore/prints.c
===================================================================

reiserfscore/prints.c 2004-03-08 10:41:23.648594772 -0500 renamed from reiserfscore/prints.c 2004-02-17 07:06:23.000000000 -0500 +0 -0
@@ -646,7 +646,7 @@ int print_super_block (FILE * fp, reiser

"bitmaps, data, reserved] blocks): %u\n",
get_sb_free_blocks (sb));
reiserfs_warning (fp, "Root block: %u\n", get_sb_root_block (sb)); }

reiserfscore/prints.c 2004-03-08 10:41:23.648594772 -0500 int print_super_block (FILE * fp, reiser · line 646

Quoted 2 lines
reiserfscore/prints.c 2004-03-08 10:41:23.648594772 -0500 renamed from reiserfscore/prints.c 2004-02-17 07:06:23.000000000 -0500 +1 -1
-    reiserfs_warning (fp, "Filesystem marked as %scleanly umounted\n",
+    reiserfs_warning (fp, "Filesystem is %sclean\n",
             (get_sb_umount_state (sb) == FS_CLEANLY_UMOUNTED) ? "" : 

"NOT ");

if (short_print)

fsck/semantic_rebuild.c 2003-02-11 10:36:49.000000000 -0500

Quoted 6 lines
reiserfscore/prints.c 2004-03-08 10:41:23.648594772 -0500 renamed from reiserfscore/prints.c 2004-02-17 07:06:23.000000000 -0500 +0 -1
-------------------------
 

diff -ur reiserfsprogs-3.6.4/fsck/semantic_rebuild.c reiserfsprogs-3.6.4.suse/fsck/semantic_rebuild.c

fsck/semantic_rebuild.c 2003-02-11 10:36:49.000000000 -0500 renamed from fsck/semantic_rebuild.c 2002-09-13 05:41:41.000000000 -0400 +0 -0
@@ -169,7 +169,8 @@

int ret = 0;

if (S_ISREG (mode) || S_ISLNK (mode) || S_ISDIR (mode)) {

fsck/semantic_rebuild.c 2003-02-11 10:36:49.000000000 -0500 line 170

Quoted 3 lines
fsck/semantic_rebuild.c 2003-02-11 10:36:49.000000000 -0500 renamed from fsck/semantic_rebuild.c 2002-09-13 05:41:41.000000000 -0400 +2 -1
-    if (*blocks != sd_blocks) {
+    if ((!S_ISLNK(mode) && *blocks != sd_blocks) ||
+        (S_ISLNK(mode) && *blocks != sd_blocks && (ROUND_UP(*blocks) != sd_blocks))) {

fsck_log ("vpf-10680: The %s %K has the wrong block count in the
StatData "

       "(%u)%s(%u)\n", S_ISDIR (mode) ? "directory" : "file",  key, 
sd_blocks,
       fsck_mode(fs) == FSCK_CHECK ? ", should be " : " - corrected to 

", *blocks);

fsck/main.c 2003-09-01 12:44:46.000000000 -0400

Quoted 5 lines
fsck/semantic_rebuild.c 2003-02-11 10:36:49.000000000 -0500 renamed from fsck/semantic_rebuild.c 2002-09-13 05:41:41.000000000 -0400 +0 -1
-------------------------
 
fsck/main.c 2003-09-01 12:44:46.000000000 -0400 renamed from fsck/main.c.1 2003-09-01 12:44:41.000000000 -0400 +0 -0
@@ -230,6 +230,7 @@

case 'a':
case 'p':

fsck/main.c 2003-09-01 12:44:46.000000000 -0400 line 230

Quoted 1 line
fsck/main.c 2003-09-01 12:44:46.000000000 -0400 renamed from fsck/main.c.1 2003-09-01 12:44:41.000000000 -0400 +1 -0
+        data->options |= OPT_QUIET;
       mode = FSCK_AUTO;
       break;

lib/misc.c 2004-05-18 16:53:19.000000000 +0200

Quoted 5 lines
fsck/main.c 2003-09-01 12:44:46.000000000 -0400 renamed from fsck/main.c.1 2003-09-01 12:44:41.000000000 -0400 +0 -1
-------------------------
 
lib/misc.c 2004-05-18 16:53:19.000000000 +0200 renamed from lib/misc.c.blkgetsiz64 2004-05-18 16:50:47.000000000 +0200 +0 -0
@@ -463,7 +463,13 @@

}

#if defined(__linux__) && defined(_IOR) && !defined(BLKGETSIZE64)

lib/misc.c 2004-05-18 16:53:19.000000000 +0200 line 469

Quoted 8 lines
lib/misc.c 2004-05-18 16:53:19.000000000 +0200 renamed from lib/misc.c.blkgetsiz64 2004-05-18 16:50:47.000000000 +0200 +7 -1
-#   define BLKGETSIZE64 _IOR(0x12, 114, __u64)
+/* Note! Despite this call being called with *64, it must be encoded to
+ * return only sizeof(size_t), since in earlier kernel versions it was
+ * declared _IOR(0x12, 114, sizeof(u64)), making it use sizeof(sizeof(u64)).
+ *
+ * However, the call itself does always return 64bit!
+ */
+#   define BLKGETSIZE64 _IOR(0x12, 114, size_t)

#endif

/* To not have problem with last sectors on the block device when switching