All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] reiserfs/xattr fix
@ 2004-08-27 16:06 Andries.Brouwer
  2004-08-27 18:04 ` Linus Torvalds
  0 siblings, 1 reply; 7+ messages in thread
From: Andries.Brouwer @ 2004-08-27 16:06 UTC (permalink / raw)
  To: akpm, torvalds; +Cc: linux-kernel

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


diff -uprN -X /linux/dontdiff a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
--- a/fs/reiserfs/xattr.c	2004-06-24 17:11:20.000000000 +0200
+++ b/fs/reiserfs/xattr.c	2004-08-27 17:54:39.000000000 +0200
@@ -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)) {

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-08-28 22:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-27 16:06 [PATCH] reiserfs/xattr fix Andries.Brouwer
2004-08-27 18:04 ` Linus Torvalds
2004-08-28  1:19   ` [PATCH] remove unused ext2_panic Andries Brouwer
2004-08-28  1:58     ` Linus Torvalds
2004-08-28 21:30       ` [PATCH] ext2 mount options doc Andries Brouwer
2004-08-28 21:46         ` Andrew Morton
2004-08-28 22:08           ` Andries Brouwer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.