From: Jan Kara <jack@suse.cz>
To: Jeff Mahoney <jeffm@jeffreymahoney.com>
Cc: reiserfs-devel <reiserfs-devel@vger.kernel.org>, Jan Kara <jack@suse.cz>
Subject: Re: [PATCH] reiserfs: fix spurious multiple-fill in reiserfs_readdir_dentry
Date: Fri, 31 May 2013 21:31:21 +0200 [thread overview]
Message-ID: <20130531193121.GA21744@quack.suse.cz> (raw)
In-Reply-To: <51A8F508.30100@jeffreymahoney.com>
On Fri 31-05-13 15:07:52, Jeff Mahoney wrote:
> After sleeping for filldir(), we check to see if the file system has
> changed and research. The next_pos pointer is updated but its value
> isn't pushed into the key used for the search itself. As a result,
> the search returns the same item that the last cycle of the loop did
> and filldir() is called multiple times with the same data.
>
> The end result is that the buffer can contain the same name multiple
> times. This can be returned to userspace or used internally in the
> xattr code where it can manifest with the following warning:
>
> jdm-20004 reiserfs_delete_xattrs: Couldn't delete all xattrs (-2)
>
> reiserfs_for_each_xattr uses reiserfs_readdir_dentry to iterate over
> the xattr names and ends up trying to unlink the same name twice. The
> second attempt fails with -ENOENT and the error is returned. At some
> point I'll need to add support into reiserfsck to remove the orphaned
> directories left behind when this occurs.
>
> The fix is to push the value into the key before researching.
The patch looks good. I've added it to my tree.
Honza
>
> Signed-off-by: Jeff Mahoney <jeffm@suse.com>
> ---
> fs/reiserfs/dir.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> --- a/fs/reiserfs/dir.c 2013-05-31 14:29:35.945840685 -0400
> +++ b/fs/reiserfs/dir.c 2013-05-31 14:30:05.473952112 -0400
> @@ -204,6 +204,8 @@ int reiserfs_readdir_dentry(struct dentr
> next_pos = deh_offset(deh) + 1;
>
> if (item_moved(&tmp_ih, &path_to_entry)) {
> + set_cpu_key_k_offset(&pos_key,
> + next_pos);
> goto research;
> }
> } /* for */
>
>
> --
> Jeff Mahoney
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2013-05-31 19:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-31 19:07 [PATCH] reiserfs: fix spurious multiple-fill in reiserfs_readdir_dentry Jeff Mahoney
2013-05-31 19:31 ` Jan Kara [this message]
2013-05-31 20:34 ` Jeff Mahoney
2013-05-31 21:04 ` Jan Kara
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=20130531193121.GA21744@quack.suse.cz \
--to=jack@suse.cz \
--cc=jeffm@jeffreymahoney.com \
--cc=reiserfs-devel@vger.kernel.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 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.