public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: akpm@linux-foundation.org
Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org,
	mszeredi@suse.cz, hch@lst.de, mark.fasheh@oracle.com,
	sage@newdream.net, trond.myklebust@fys.uio.no,
	zach.brown@oracle.com
Subject: Re: [patch 01/12] vfs: fix vfs_rename_dir for FS_RENAME_DOES_D_MOVE filesystems
Date: Fri, 07 Aug 2009 10:36:48 +0900	[thread overview]
Message-ID: <87skg42ymn.fsf@devron.myhome.or.jp> (raw)
In-Reply-To: <200908062310.n76NA7BM012675@imap1.linux-foundation.org> (akpm@linux-foundation.org's message of "Thu, 06 Aug 2009 16:10:07 -0700")

akpm@linux-foundation.org writes:

> diff -puN fs/namei.c~vfs-fix-vfs_rename_dir-for-fs_rename_does_d_move-filesystems fs/namei.c
> --- a/fs/namei.c~vfs-fix-vfs_rename_dir-for-fs_rename_does_d_move-filesystems
> +++ a/fs/namei.c
> @@ -2595,8 +2595,6 @@ static int vfs_rename_dir(struct inode *
>  		if (!error)
>  			target->i_flags |= S_DEAD;
>  		mutex_unlock(&target->i_mutex);
> -		if (d_unhashed(new_dentry))
> -			d_rehash(new_dentry);
>  		dput(new_dentry);
>  	}
>  	if (!error)

It breaks the error handling?

I.e.

	if (target) {
		mutex_lock(&target->i_mutex);
		dentry_unhash(new_dentry);                   <= unhash
	}
	if (d_mountpoint(old_dentry)||d_mountpoint(new_dentry))
		error = -EBUSY;                              <= error
	else 
		error = old_dir->i_op->rename();             <= or return error
	if (target) {
		if (!error)
			target->i_flags |= S_DEAD;
		mutex_unlock(&target->i_mutex);
                                                             <= doesn't rehash
		dput(new_dentry);
	}

Thanks.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

  reply	other threads:[~2009-08-07  1:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-06 23:10 [patch 01/12] vfs: fix vfs_rename_dir for FS_RENAME_DOES_D_MOVE filesystems akpm
2009-08-07  1:36 ` OGAWA Hirofumi [this message]
2009-08-07  4:05   ` Sage Weil
2009-08-07  5:00     ` OGAWA Hirofumi

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=87skg42ymn.fsf@devron.myhome.or.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=akpm@linux-foundation.org \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mark.fasheh@oracle.com \
    --cc=mszeredi@suse.cz \
    --cc=sage@newdream.net \
    --cc=trond.myklebust@fys.uio.no \
    --cc=viro@zeniv.linux.org.uk \
    --cc=zach.brown@oracle.com \
    /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