Skip to contentSkip to conversation

reiserfs/xattr fix

PATCH In review [email protected] 3 participants 7 messages Aug 27, 2004 – Aug 28, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 reiserfs/xattr fix

Yesterday or so I wrote:

[Ha, now that I write about the same md5sum: is it well-known that reiserfs was/is broken? This is what I noticed yesterday on 2.6.7, have not yet investigated it closely, except for verifying that coinciding r5 hash is involved.

   # mount /dev/xxx /mnt -t reiserfs
   # cd /mnt
   # echo hoi > ml
   # cat na
   hoi
   # ls -li ml na
   9 -rw-r--r--  1 root root 4 2004-08-25 17:53 ml
   9 -rw-r--r--  1 root root 4 2004-08-25 17:53 na
   # rm na
   # cat ml
   cat: ml: No such file or directory
]

This same bug exists on 2.6.8.1. It is fixed by the patch below.

Andries

fs/reiserfs/xattr.c +7 -1
diff -uprN -X /linux/dontdiff a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
@@ -1235,7 +1235,13 @@ reiserfs_xattr_unregister_handlers (void
 static int
 xattr_lookup_poison (struct dentry *dentry, struct qstr *q1, struct qstr *name)
 {
-    struct dentry *priv_root = REISERFS_SB(dentry->d_sb)->priv_root;
+    struct dentry *priv_root;
+
+    /* first the ordinary comparison */
+    if (q1->len != name->len || memcmp(q1->name, name->name, name->len))
+	return -ENOENT;
+    /* when found, reject if private */
+    priv_root = REISERFS_SB(dentry->d_sb)->priv_root;
     if (name->len == priv_root->d_name.len &&
         name->hash == priv_root->d_name.hash &&
         !memcmp (name->name, priv_root->d_name.name, name->len)) {
#1 lore raw
Quoted 2 lines · On Fri, 27 Aug 2004 [email protected] wrote:

This same bug exists on 2.6.8.1. It is fixed by the patch below.

Fixed (slightly differently) in current -BK. Thanks,

Linus

#2 lore raw

PATCH 1/1 remove unused ext2_panic

Quoted 1 line · Linus Torvalds

Fixed (slightly differently) in current -BK.

Don't see it yet. Something else: ext2_panic is unused, it seems.

Andries

fs/ext2/ext2.h +0 -3
diff -uprN -X /linux/dontdiff a/fs/ext2/ext2.h b/fs/ext2/ext2.h
@@ -131,9 +131,6 @@ extern int ext2_ioctl (struct inode *, s
 /* super.c */
 extern void ext2_error (struct super_block *, const char *, const char *, ...)
 	__attribute__ ((format (printf, 3, 4)));
-extern NORET_TYPE void ext2_panic (struct super_block *, const char *,
-				   const char *, ...)
-	__attribute__ ((NORET_AND format (printf, 3, 4)));
 extern void ext2_warning (struct super_block *, const char *, const char *, ...)
 	__attribute__ ((format (printf, 3, 4)));
 extern void ext2_update_dynamic_rev (struct super_block *sb);
fs/ext2/super.c +0 -21
diff -uprN -X /linux/dontdiff a/fs/ext2/super.c b/fs/ext2/super.c
@@ -66,27 +66,6 @@ void ext2_error (struct super_block * sb
 	}
 }
 
-NORET_TYPE void ext2_panic (struct super_block * sb, const char * function,
-			    const char * fmt, ...)
-{
-	va_list args;
-	struct ext2_sb_info *sbi = EXT2_SB(sb);
-
-	if (!(sb->s_flags & MS_RDONLY)) {
-		sbi->s_mount_state |= EXT2_ERROR_FS;
-		sbi->s_es->s_state =
-			cpu_to_le16(le16_to_cpu(sbi->s_es->s_state) | EXT2_ERROR_FS);
-		mark_buffer_dirty(sbi->s_sbh);
-		sb->s_dirt = 1;
-	}
-	va_start (args, fmt);
-	vsprintf (error_buf, fmt, args);
-	va_end (args);
-	sb->s_flags |= MS_RDONLY;
-	panic ("EXT2-fs panic (device %s): %s: %s\n",
-	       sb->s_id, function, error_buf);
-}
-
 void ext2_warning (struct super_block * sb, const char * function,
 		   const char * fmt, ...)
 {
#3 lore raw

Re: [PATCH] remove unused ext2_panic

Quoted 2 lines · Andries Brouwer

Don't see it yet.

It's in the "else" part of the if, so you may not have noticed.

Quoted 1 line

Something else: ext2_panic is unused, it seems.

Hmm, yes indeed.

Linus

#4 lore raw

PATCH 1/1 ext2 mount options doc

Updated mount.8, and in the process added a few words to Documentation/filesystems/ext2.txt too.

Andries

Documentation/filesystems/ext2.txt +21 -3
diff -uprN -X /linux/dontdiff a/Documentation/filesystems/ext2.txt b/Documentation/filesystems/ext2.txt
@@ -12,29 +12,47 @@ Options
 =======
 
 When mounting an ext2 filesystem, the following options are accepted.
-Defaults are marked with (*).
+Most defaults are determined by the filesystem superblock, and can be
+set using tune2fs(8). Kernel-determined defaults are indicated by (*).
 
 bsddf			(*)	Makes `df' act like BSD.
 minixdf				Makes `df' act like Minix.
 
+check				Check block and inode bitmaps at mount time
+				(requires CONFIG_EXT2_CHECK).
 check=none, nocheck	(*)	Don't do extra checking of bitmaps on mount
 				(check=normal and check=strict options removed)
 
 debug				Extra debugging information is sent to the
 				kernel syslog.  Useful for developers.
 
-errors=continue		(*)	Keep going on a filesystem error.
+errors=continue			Keep going on a filesystem error.
 errors=remount-ro		Remount the filesystem read-only on an error.
 errors=panic			Panic and halt the machine if an error occurs.
 
 grpid, bsdgroups		Give objects the same group ID as their parent.
-nogrpid, sysvgroups	(*)	New objects have the group ID of their creator.
+nogrpid, sysvgroups		New objects have the group ID of their creator.
 
 resuid=n			The user ID which may use the reserved blocks.
 resgid=n			The group ID which may use the reserved blocks. 
 
 sb=n				Use alternate superblock at this location.
 
+nouid32				Use 16-bit UIDs and GIDs.
+
+oldalloc			Use old allocator for new inodes.
+orlov			(*)	Use Orlov allocator.
+
+nobh				Do not attach buffer_heads to file pagecache.
+
+user_xattr			Support "user." extended attributes
+				(requires CONFIG_EXT2_FS_XATTR).
+nouser_xattr			Don't support "user." extended attributes.
+
+acl				Support POSIX Access Control Lists
+				(requires CONFIG_EXT2_FS_POSIX_ACL).
+noacl				Don't support POSIX ACLs.
+
 grpquota,noquota,quota,usrquota	Quota options are silently ignored by ext2.
 
 
#5 lore raw

Re: [PATCH] ext2 mount options doc

Quoted 3 lines · Andries Brouwer

Updated mount.8, and in the process added a few words to
Documentation/filesystems/ext2.txt too.

Linus's ext2.txt has recently been updated, so your patch generates 100% rejects.

#6 lore raw

Re: [PATCH] ext2 mount options doc

Quoted 7 lines · Andrew Morton
Quoted 2 lines · Andries Brouwer

Updated mount.8, and in the process added a few words to
Documentation/filesystems/ext2.txt too.

Linus's ext2.txt has recently been updated, so your patch generates 100% rejects.

Good - no doubt that means that my update is superfluous already. Let me see..

Hmm. This new file documents barrier=1 and I did not. Does that really apply to ext2?

Otherwise the changes agree, except that I documented that since 2.5.46 most defaults are not determined by the kernel but by the superblock. (So some *'s should be deleted.)

(Will not send a new patch now. Maybe later.)

Andries