mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <Andries.Brouwer@cwi.nl>
To: akpm@osdl.org, torvalds@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] reiserfs/xattr fix
Date: Fri, 27 Aug 2004 18:06:55 +0200 (MEST)	[thread overview]
Message-ID: <UTC200408271606.i7RG6tV27596.aeb@smtp.cwi.nl> (raw)

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)) {

             reply	other threads:[~2004-08-27 16:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-27 16:06 Andries.Brouwer [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=UTC200408271606.i7RG6tV27596.aeb@smtp.cwi.nl \
    --to=andries.brouwer@cwi.nl \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®