* [PATCH 00/26] Some final dentry_unhash cleanup
@ 2011-05-27 20:41 Sage Weil
2011-05-27 20:41 ` [PATCH 01/26] bfs: remove unnecessary dentry_unhash on dir rename Sage Weil
` (25 more replies)
0 siblings, 26 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:41 UTC (permalink / raw)
To: hch, viro; +Cc: linux-fsdevel, Sage Weil
Hi Christoph, Al,
This is some final (I think!) cleanup on the dentry_unhash thing. There
are now only three remaining callers:
- autofs4 does tricky things that I don't want to fully get into...
I'm following up with Ian and the list.
- hpfs has some heroics on ENOSPC that I don't want to touch.
- ncpfs basically the one fs that uses dentry_unhash as intended.
There is also a fix for ncpfs's rename, which wasn't performing the same
check as rmdir was.
I did a quick check of 'git grep d_unhashed fs' results to look for any
file systems that might care about whether the dentry was hashed or not
during rmdir/rename. The only thing that looked scary was
configfs_drop_dentry, but as far as I can tell it looks okay.
This is on top of the previous patch set. Each patch CCs
appropriate maintainers/lists. The whole thing (these patches and
the original series) can be grabbed from
git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git more_dentry_unhash
Thanks!
sage
Sage Weil (26):
bfs: remove unnecessary dentry_unhash on dir rename
sysv: remove unnecessary dentry_unhash from rmdir, dir rename
jffs2: remove unnecessary dentry_unhash from rmdir, dir rename
jfs: remove unnecessary dentry_unhash from rmdir, dir rename
logfs: remove unnecessary dentry_unhash from rmdir, dir rename
nilfs2: remove unnecessary dentry_unhash from rmdir, dir rename
ubifs: remove unnecessary dentry_unhash from rmdir, dir rename
ufs: remove unnecessary dentry_unhash from rmdir, dir rename
reiserfs: remove unnecessary dentry_unhash from rmdir, dir rename
udf: remove unnecessary dentry_unhash from rmdir, dir rename
omfs: remove unnecessary dentry_unhash on rmdir, dir rneame
hfs: remove unnecessary dentry_unhash on rmdir, dir rename
hfsplus: remove unnecessary dentry_unhash on rmdir, dir rename
hostfs: remove unnecessary dentry_unhash on rmdir, dir rename
ecryptfs: remove unnecessary dentry_unhash on rmdir, dir rename
ncpfs: document dentry_unhash usage
ncpfs: fix rename over directory with dangling references
9p: remove unnecessary dentry_unhash on rmdir, dir rename
affs: remove unnecessary dentry_unhash on rmdir, dir rename
afs: remove unnecessary dentry_unhash on rmdir, dir rename
coda: remove unnecessary dentry_unhash on rmdir, dir rename
fuse: remove unnecessary dentry_unhash on rmdir, dir rename
minix: remove unnecessary dentry_unhash on rmdir, dir rename
hpfs: remove unnecessary dentry_unhash on rmdir, dir rename
fat: remove unnecessary dentry_unhash on rmdir, dir rename
configfs: remove unnecessary dentry_unhash on rmdir, dir rename
fs/9p/vfs_inode.c | 4 ----
fs/affs/namei.c | 5 -----
fs/afs/dir.c | 5 -----
fs/bfs/dir.c | 3 ---
fs/coda/dir.c | 5 -----
fs/configfs/dir.c | 2 --
fs/ecryptfs/inode.c | 5 -----
fs/fat/namei_msdos.c | 5 -----
fs/fat/namei_vfat.c | 5 -----
fs/fuse/dir.c | 5 -----
fs/hfs/dir.c | 6 ------
fs/hfsplus/dir.c | 8 ++------
fs/hostfs/hostfs_kern.c | 5 -----
fs/hpfs/namei.c | 5 -----
fs/jffs2/dir.c | 5 -----
fs/jfs/namei.c | 5 -----
fs/logfs/dir.c | 5 -----
fs/minix/namei.c | 5 -----
fs/ncpfs/dir.c | 15 +++++++++++++--
fs/nilfs2/namei.c | 5 -----
fs/omfs/dir.c | 11 +++--------
fs/reiserfs/namei.c | 5 -----
fs/reiserfs/xattr.c | 1 -
fs/sysv/namei.c | 5 -----
fs/ubifs/dir.c | 5 -----
fs/udf/namei.c | 5 -----
fs/ufs/namei.c | 5 -----
27 files changed, 18 insertions(+), 127 deletions(-)
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 01/26] bfs: remove unnecessary dentry_unhash on dir rename
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
@ 2011-05-27 20:41 ` Sage Weil
2011-05-27 20:41 ` [PATCH 02/26] sysv: remove unnecessary dentry_unhash from rmdir, " Sage Weil
` (24 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:41 UTC (permalink / raw)
To: hch, viro; +Cc: linux-fsdevel, Sage Weil, tigran
Bfs does not have problems with references to unlinked directories.
CC: tigran@aivazian.fsnet.co.uk
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/bfs/dir.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c
index c7d1d06..b14cebf 100644
--- a/fs/bfs/dir.c
+++ b/fs/bfs/dir.c
@@ -224,9 +224,6 @@ static int bfs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct bfs_sb_info *info;
int error = -ENOENT;
- if (new_dentry->d_inode && S_ISDIR(new_dentry->d_inode->i_mode))
- dentry_unhash(new_dentry);
-
old_bh = new_bh = NULL;
old_inode = old_dentry->d_inode;
if (S_ISDIR(old_inode->i_mode))
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 02/26] sysv: remove unnecessary dentry_unhash from rmdir, dir rename
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
2011-05-27 20:41 ` [PATCH 01/26] bfs: remove unnecessary dentry_unhash on dir rename Sage Weil
@ 2011-05-27 20:41 ` Sage Weil
2011-05-27 20:41 ` [PATCH 03/26] jffs2: " Sage Weil
` (23 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:41 UTC (permalink / raw)
To: hch, viro; +Cc: linux-fsdevel, Sage Weil
sysv does not have problems with references to unlinked directories.
CC: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/sysv/namei.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/fs/sysv/namei.c b/fs/sysv/namei.c
index e2cc675..e474fbc 100644
--- a/fs/sysv/namei.c
+++ b/fs/sysv/namei.c
@@ -196,8 +196,6 @@ static int sysv_rmdir(struct inode * dir, struct dentry * dentry)
struct inode *inode = dentry->d_inode;
int err = -ENOTEMPTY;
- dentry_unhash(dentry);
-
if (sysv_empty_dir(inode)) {
err = sysv_unlink(dir, dentry);
if (!err) {
@@ -224,9 +222,6 @@ static int sysv_rename(struct inode * old_dir, struct dentry * old_dentry,
struct sysv_dir_entry * old_de;
int err = -ENOENT;
- if (new_inode && S_ISDIR(new_inode->i_mode))
- dentry_unhash(new_dentry);
-
old_de = sysv_find_entry(old_dentry, &old_page);
if (!old_de)
goto out;
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 03/26] jffs2: remove unnecessary dentry_unhash from rmdir, dir rename
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
2011-05-27 20:41 ` [PATCH 01/26] bfs: remove unnecessary dentry_unhash on dir rename Sage Weil
2011-05-27 20:41 ` [PATCH 02/26] sysv: remove unnecessary dentry_unhash from rmdir, " Sage Weil
@ 2011-05-27 20:41 ` Sage Weil
2011-05-27 20:41 ` [PATCH 04/26] jfs: " Sage Weil
` (22 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:41 UTC (permalink / raw)
To: hch, viro; +Cc: linux-fsdevel, Sage Weil, David Woodhouse, linux-mtd
jffs2 does not have problems with references to unlinked directories.
CC: David Woodhouse <dwmw2@infradead.org>
CC: linux-mtd@lists.infradead.org
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/jffs2/dir.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c
index 05f7332..82faddd 100644
--- a/fs/jffs2/dir.c
+++ b/fs/jffs2/dir.c
@@ -609,8 +609,6 @@ static int jffs2_rmdir (struct inode *dir_i, struct dentry *dentry)
int ret;
uint32_t now = get_seconds();
- dentry_unhash(dentry);
-
for (fd = f->dents ; fd; fd = fd->next) {
if (fd->ino)
return -ENOTEMPTY;
@@ -786,9 +784,6 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
uint8_t type;
uint32_t now;
- if (new_dentry->d_inode && S_ISDIR(new_dentry->d_inode->i_mode))
- dentry_unhash(new_dentry);
-
/* The VFS will check for us and prevent trying to rename a
* file over a directory and vice versa, but if it's a directory,
* the VFS can't check whether the victim is empty. The filesystem
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 04/26] jfs: remove unnecessary dentry_unhash from rmdir, dir rename
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
` (2 preceding siblings ...)
2011-05-27 20:41 ` [PATCH 03/26] jffs2: " Sage Weil
@ 2011-05-27 20:41 ` Sage Weil
2011-05-27 20:41 ` [PATCH 05/26] logfs: " Sage Weil
` (21 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:41 UTC (permalink / raw)
To: hch, viro; +Cc: linux-fsdevel, Sage Weil, Dave Kleikamp, jfs-discussion
jfs does not have problems with references to unlinked directories.
CC: Dave Kleikamp <shaggy@kernel.org>
CC: jfs-discussion@lists.sourceforge.net
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/jfs/namei.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index 865df16..eaaf2b5 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -360,8 +360,6 @@ static int jfs_rmdir(struct inode *dip, struct dentry *dentry)
jfs_info("jfs_rmdir: dip:0x%p name:%s", dip, dentry->d_name.name);
- dentry_unhash(dentry);
-
/* Init inode for quota operations. */
dquot_initialize(dip);
dquot_initialize(ip);
@@ -1097,9 +1095,6 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
jfs_info("jfs_rename: %s %s", old_dentry->d_name.name,
new_dentry->d_name.name);
- if (new_dentry->d_inode && S_ISDIR(new_dentry->d_inode->i_mode))
- dentry_unhash(new_dentry);
-
dquot_initialize(old_dir);
dquot_initialize(new_dir);
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 05/26] logfs: remove unnecessary dentry_unhash from rmdir, dir rename
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
` (3 preceding siblings ...)
2011-05-27 20:41 ` [PATCH 04/26] jfs: " Sage Weil
@ 2011-05-27 20:41 ` Sage Weil
[not found] ` <1306528939-30636-1-git-send-email-sage-BnTBU8nroG7k1uMJSBkQmQ@public.gmane.org>
` (20 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:41 UTC (permalink / raw)
To: hch, viro; +Cc: linux-fsdevel, Sage Weil, Joern Engel, logfs
logfs does not have problems with references to unlinked directories.
CC: Joern Engel <joern@logfs.org>
CC: logfs@logfs.org
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/logfs/dir.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/fs/logfs/dir.c b/fs/logfs/dir.c
index f34c9cd..9ed89d1 100644
--- a/fs/logfs/dir.c
+++ b/fs/logfs/dir.c
@@ -273,8 +273,6 @@ static int logfs_rmdir(struct inode *dir, struct dentry *dentry)
{
struct inode *inode = dentry->d_inode;
- dentry_unhash(dentry);
-
if (!logfs_empty_dir(inode))
return -ENOTEMPTY;
@@ -624,9 +622,6 @@ static int logfs_rename_cross(struct inode *old_dir, struct dentry *old_dentry,
loff_t pos;
int err;
- if (new_dentry->d_inode && S_ISDIR(new_dentry->d_inode->i_mode))
- dentry_unhash(new_dentry);
-
/* 1. locate source dd */
err = logfs_get_dd(old_dir, old_dentry, &dd, &pos);
if (err)
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 06/26] nilfs2: remove unnecessary dentry_unhash from rmdir, dir rename
[not found] ` <1306528939-30636-1-git-send-email-sage-BnTBU8nroG7k1uMJSBkQmQ@public.gmane.org>
@ 2011-05-27 20:41 ` Sage Weil
0 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:41 UTC (permalink / raw)
To: hch-wEGCiKHe2LqWVfeAwA7xHQ, viro-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn
Cc: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA, Sage Weil, KONISHI Ryusuke,
linux-nilfs-u79uwXL29TY76Z2rM5mHXA
nilfs2 does not have problems with references to unlinked directories.
CC: KONISHI Ryusuke <konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org>
CC: linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Signed-off-by: Sage Weil <sage-BnTBU8nroG7k1uMJSBkQmQ@public.gmane.org>
---
fs/nilfs2/namei.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/fs/nilfs2/namei.c b/fs/nilfs2/namei.c
index 1102a5f..546849b 100644
--- a/fs/nilfs2/namei.c
+++ b/fs/nilfs2/namei.c
@@ -334,8 +334,6 @@ static int nilfs_rmdir(struct inode *dir, struct dentry *dentry)
struct nilfs_transaction_info ti;
int err;
- dentry_unhash(dentry);
-
err = nilfs_transaction_begin(dir->i_sb, &ti, 0);
if (err)
return err;
@@ -371,9 +369,6 @@ static int nilfs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct nilfs_transaction_info ti;
int err;
- if (new_inode && S_ISDIR(new_inode->i_mode))
- dentry_unhash(new_dentry);
-
err = nilfs_transaction_begin(old_dir->i_sb, &ti, 1);
if (unlikely(err))
return err;
--
1.7.0
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 07/26] ubifs: remove unnecessary dentry_unhash from rmdir, dir rename
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
@ 2011-05-27 20:42 ` Sage Weil
2011-05-27 20:41 ` [PATCH 02/26] sysv: remove unnecessary dentry_unhash from rmdir, " Sage Weil
` (24 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:42 UTC (permalink / raw)
To: hch, viro
Cc: linux-fsdevel, Sage Weil, Artem Bityutskiy, Adrian Hunter, linux-mtd
ubifs does not have problems with references to unlinked directories.
CC: Artem Bityutskiy <dedekind1@gmail.com>
CC: Adrian Hunter <adrian.hunter@nokia.com>
CC: linux-mtd@lists.infradead.org
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/ubifs/dir.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index d80810b..7217d67 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -656,8 +656,6 @@ static int ubifs_rmdir(struct inode *dir, struct dentry *dentry)
struct ubifs_inode *dir_ui = ubifs_inode(dir);
struct ubifs_budget_req req = { .mod_dent = 1, .dirtied_ino = 2 };
- dentry_unhash(dentry);
-
/*
* Budget request settings: deletion direntry, deletion inode and
* changing the parent inode. If budgeting fails, go ahead anyway
@@ -978,9 +976,6 @@ static int ubifs_rename(struct inode *old_dir, struct dentry *old_dentry,
.dirtied_ino_d = ALIGN(old_inode_ui->data_len, 8) };
struct timespec time;
- if (new_inode && S_ISDIR(new_inode->i_mode))
- dentry_unhash(new_dentry);
-
/*
* Budget request settings: deletion direntry, new direntry, removing
* the old inode, and changing old and new parent directory inodes.
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 07/26] ubifs: remove unnecessary dentry_unhash from rmdir, dir rename
@ 2011-05-27 20:42 ` Sage Weil
0 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:42 UTC (permalink / raw)
To: hch, viro
Cc: linux-fsdevel, Sage Weil, Adrian Hunter, linux-mtd, Artem Bityutskiy
ubifs does not have problems with references to unlinked directories.
CC: Artem Bityutskiy <dedekind1@gmail.com>
CC: Adrian Hunter <adrian.hunter@nokia.com>
CC: linux-mtd@lists.infradead.org
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/ubifs/dir.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index d80810b..7217d67 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -656,8 +656,6 @@ static int ubifs_rmdir(struct inode *dir, struct dentry *dentry)
struct ubifs_inode *dir_ui = ubifs_inode(dir);
struct ubifs_budget_req req = { .mod_dent = 1, .dirtied_ino = 2 };
- dentry_unhash(dentry);
-
/*
* Budget request settings: deletion direntry, deletion inode and
* changing the parent inode. If budgeting fails, go ahead anyway
@@ -978,9 +976,6 @@ static int ubifs_rename(struct inode *old_dir, struct dentry *old_dentry,
.dirtied_ino_d = ALIGN(old_inode_ui->data_len, 8) };
struct timespec time;
- if (new_inode && S_ISDIR(new_inode->i_mode))
- dentry_unhash(new_dentry);
-
/*
* Budget request settings: deletion direntry, new direntry, removing
* the old inode, and changing old and new parent directory inodes.
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 08/26] ufs: remove unnecessary dentry_unhash from rmdir, dir rename
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
` (6 preceding siblings ...)
2011-05-27 20:42 ` Sage Weil
@ 2011-05-27 20:42 ` Sage Weil
2011-05-27 20:42 ` [PATCH 09/26] reiserfs: " Sage Weil
` (17 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:42 UTC (permalink / raw)
To: hch, viro; +Cc: linux-fsdevel, Sage Weil, Evgeniy Dushistov
ufs does not have problems with references to unlinked directories.
CC: Evgeniy Dushistov <dushistov@mail.ru>
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/ufs/namei.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c
index 953ebdf..29309e2 100644
--- a/fs/ufs/namei.c
+++ b/fs/ufs/namei.c
@@ -258,8 +258,6 @@ static int ufs_rmdir (struct inode * dir, struct dentry *dentry)
struct inode * inode = dentry->d_inode;
int err= -ENOTEMPTY;
- dentry_unhash(dentry);
-
lock_ufs(dir->i_sb);
if (ufs_empty_dir (inode)) {
err = ufs_unlink(dir, dentry);
@@ -284,9 +282,6 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct ufs_dir_entry *old_de;
int err = -ENOENT;
- if (new_inode && S_ISDIR(new_inode->i_mode))
- dentry_unhash(new_dentry);
-
old_de = ufs_find_entry(old_dir, &old_dentry->d_name, &old_page);
if (!old_de)
goto out;
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 09/26] reiserfs: remove unnecessary dentry_unhash from rmdir, dir rename
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
` (7 preceding siblings ...)
2011-05-27 20:42 ` [PATCH 08/26] ufs: " Sage Weil
@ 2011-05-27 20:42 ` Sage Weil
2011-05-27 20:42 ` [PATCH 10/26] udf: " Sage Weil
` (16 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:42 UTC (permalink / raw)
To: hch, viro; +Cc: linux-fsdevel, Sage Weil, reiserfs-devel
Reiserfs does not have problems with references to unlinked directories.
CC: reiserfs-devel@vger.kernel.org
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/reiserfs/namei.c | 5 -----
fs/reiserfs/xattr.c | 1 -
2 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
index 76c8164..1186626 100644
--- a/fs/reiserfs/namei.c
+++ b/fs/reiserfs/namei.c
@@ -831,8 +831,6 @@ static int reiserfs_rmdir(struct inode *dir, struct dentry *dentry)
INITIALIZE_PATH(path);
struct reiserfs_dir_entry de;
- dentry_unhash(dentry);
-
/* we will be doing 2 balancings and update 2 stat data, we change quotas
* of the owner of the directory and of the owner of the parent directory.
* The quota structure is possibly deleted only on last iput => outside
@@ -1227,9 +1225,6 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry,
unsigned long savelink = 1;
struct timespec ctime;
- if (new_dentry->d_inode && S_ISDIR(new_dentry->d_inode->i_mode))
- dentry_unhash(new_dentry);
-
/* three balancings: (1) old name removal, (2) new name insertion
and (3) maybe "save" link insertion
stat data updates: (1) old directory,
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index 50f1abc..e8a62f4 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -98,7 +98,6 @@ static int xattr_rmdir(struct inode *dir, struct dentry *dentry)
reiserfs_mutex_lock_nested_safe(&dentry->d_inode->i_mutex,
I_MUTEX_CHILD, dir->i_sb);
- dentry_unhash(dentry);
error = dir->i_op->rmdir(dir, dentry);
if (!error)
dentry->d_inode->i_flags |= S_DEAD;
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 10/26] udf: remove unnecessary dentry_unhash from rmdir, dir rename
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
` (8 preceding siblings ...)
2011-05-27 20:42 ` [PATCH 09/26] reiserfs: " Sage Weil
@ 2011-05-27 20:42 ` Sage Weil
2011-05-30 9:43 ` Jan Kara
2011-05-27 20:42 ` [PATCH 11/26] omfs: remove unnecessary dentry_unhash on rmdir, dir rneame Sage Weil
` (15 subsequent siblings)
25 siblings, 1 reply; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:42 UTC (permalink / raw)
To: hch, viro; +Cc: linux-fsdevel, Sage Weil, Jan Kara
udf does not have problems with references to unlinked directories.
CC: Jan Kara <jack@suse.cz>
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/udf/namei.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/fs/udf/namei.c b/fs/udf/namei.c
index 4d76594..f1dce84 100644
--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -783,8 +783,6 @@ static int udf_rmdir(struct inode *dir, struct dentry *dentry)
struct fileIdentDesc *fi, cfi;
struct kernel_lb_addr tloc;
- dentry_unhash(dentry);
-
retval = -ENOENT;
fi = udf_find_entry(dir, &dentry->d_name, &fibh, &cfi);
if (!fi)
@@ -1083,9 +1081,6 @@ static int udf_rename(struct inode *old_dir, struct dentry *old_dentry,
struct kernel_lb_addr tloc;
struct udf_inode_info *old_iinfo = UDF_I(old_inode);
- if (new_inode && S_ISDIR(new_inode->i_mode))
- dentry_unhash(new_dentry);
-
ofi = udf_find_entry(old_dir, &old_dentry->d_name, &ofibh, &ocfi);
if (ofi) {
if (ofibh.sbh != ofibh.ebh)
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 11/26] omfs: remove unnecessary dentry_unhash on rmdir, dir rneame
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
` (9 preceding siblings ...)
2011-05-27 20:42 ` [PATCH 10/26] udf: " Sage Weil
@ 2011-05-27 20:42 ` Sage Weil
2011-06-05 0:42 ` Bob Copeland
2011-05-27 20:42 ` [PATCH 12/26] hfs: remove unnecessary dentry_unhash on rmdir, dir rename Sage Weil
` (14 subsequent siblings)
25 siblings, 1 reply; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:42 UTC (permalink / raw)
To: hch, viro; +Cc: linux-fsdevel, Sage Weil, Bob Copeland, linux-karma-devel
omfs does not have problems with references to unlinked directories.
CC: Bob Copeland <me@bobcopeland.com>
CC: linux-karma-devel@lists.sourceforge.net
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/omfs/dir.c | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/fs/omfs/dir.c b/fs/omfs/dir.c
index c368360..3b8d397 100644
--- a/fs/omfs/dir.c
+++ b/fs/omfs/dir.c
@@ -241,11 +241,9 @@ static int omfs_remove(struct inode *dir, struct dentry *dentry)
int ret;
- if (S_ISDIR(inode->i_mode)) {
- dentry_unhash(dentry);
- if (!omfs_dir_is_empty(inode))
- return -ENOTEMPTY;
- }
+ if (S_ISDIR(inode->i_mode) &&
+ !omfs_dir_is_empty(inode))
+ return -ENOTEMPTY;
ret = omfs_delete_entry(dentry);
if (ret)
@@ -382,9 +380,6 @@ static int omfs_rename(struct inode *old_dir, struct dentry *old_dentry,
int err;
if (new_inode) {
- if (S_ISDIR(new_inode->i_mode))
- dentry_unhash(new_dentry);
-
/* overwriting existing file/dir */
err = omfs_remove(new_dir, new_dentry);
if (err)
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 12/26] hfs: remove unnecessary dentry_unhash on rmdir, dir rename
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
` (10 preceding siblings ...)
2011-05-27 20:42 ` [PATCH 11/26] omfs: remove unnecessary dentry_unhash on rmdir, dir rneame Sage Weil
@ 2011-05-27 20:42 ` Sage Weil
2011-05-27 20:42 ` [PATCH 13/26] hfsplus: " Sage Weil
` (13 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:42 UTC (permalink / raw)
To: hch, viro; +Cc: linux-fsdevel, Sage Weil
hfs does not have problems with references to unlinked directories.
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/hfs/dir.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c
index 1cb70cd..b4d70b1 100644
--- a/fs/hfs/dir.c
+++ b/fs/hfs/dir.c
@@ -253,9 +253,6 @@ static int hfs_remove(struct inode *dir, struct dentry *dentry)
struct inode *inode = dentry->d_inode;
int res;
- if (S_ISDIR(inode->i_mode))
- dentry_unhash(dentry);
-
if (S_ISDIR(inode->i_mode) && inode->i_size != 2)
return -ENOTEMPTY;
res = hfs_cat_delete(inode->i_ino, dir, &dentry->d_name);
@@ -286,9 +283,6 @@ static int hfs_rename(struct inode *old_dir, struct dentry *old_dentry,
/* Unlink destination if it already exists */
if (new_dentry->d_inode) {
- if (S_ISDIR(new_dentry->d_inode->i_mode))
- dentry_unhash(new_dentry);
-
res = hfs_remove(new_dir, new_dentry);
if (res)
return res;
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 13/26] hfsplus: remove unnecessary dentry_unhash on rmdir, dir rename
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
` (11 preceding siblings ...)
2011-05-27 20:42 ` [PATCH 12/26] hfs: remove unnecessary dentry_unhash on rmdir, dir rename Sage Weil
@ 2011-05-27 20:42 ` Sage Weil
2011-05-27 20:42 ` [uml-devel] " Sage Weil
` (12 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:42 UTC (permalink / raw)
To: hch, viro; +Cc: linux-fsdevel, Sage Weil
hfsplus does not have problems with references to unlinked directories.
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/hfsplus/dir.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c
index b288350..4df5059 100644
--- a/fs/hfsplus/dir.c
+++ b/fs/hfsplus/dir.c
@@ -370,8 +370,6 @@ static int hfsplus_rmdir(struct inode *dir, struct dentry *dentry)
struct inode *inode = dentry->d_inode;
int res;
- dentry_unhash(dentry);
-
if (inode->i_size != 2)
return -ENOTEMPTY;
@@ -469,12 +467,10 @@ static int hfsplus_rename(struct inode *old_dir, struct dentry *old_dentry,
/* Unlink destination if it already exists */
if (new_dentry->d_inode) {
- if (S_ISDIR(new_dentry->d_inode->i_mode)) {
- dentry_unhash(new_dentry);
+ if (S_ISDIR(new_dentry->d_inode->i_mode))
res = hfsplus_rmdir(new_dir, new_dentry);
- } else {
+ else
res = hfsplus_unlink(new_dir, new_dentry);
- }
if (res)
return res;
}
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 14/26] hostfs: remove unnecessary dentry_unhash on rmdir, dir rename
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
@ 2011-05-27 20:42 ` Sage Weil
2011-05-27 20:41 ` [PATCH 02/26] sysv: remove unnecessary dentry_unhash from rmdir, " Sage Weil
` (24 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:42 UTC (permalink / raw)
To: hch, viro
Cc: linux-fsdevel, Sage Weil, Jeff Dike, Richard Weinberger,
user-mode-linux-devel
hostfs does not have problems with references to unlinked directories.
CC: Jeff Dike <jdike@addtoit.com>
CC: Richard Weinberger <richard@nod.at>
CC: user-mode-linux-devel@lists.sourceforge.net
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/hostfs/hostfs_kern.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index e6816b9..2638c83 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -683,8 +683,6 @@ int hostfs_rmdir(struct inode *ino, struct dentry *dentry)
char *file;
int err;
- dentry_unhash(dentry);
-
if ((file = dentry_name(dentry)) == NULL)
return -ENOMEM;
err = do_rmdir(file);
@@ -738,9 +736,6 @@ int hostfs_rename(struct inode *from_ino, struct dentry *from,
char *from_name, *to_name;
int err;
- if (to->d_inode && S_ISDIR(to->d_inode->i_mode))
- dentry_unhash(to);
-
if ((from_name = dentry_name(from)) == NULL)
return -ENOMEM;
if ((to_name = dentry_name(to)) == NULL) {
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [uml-devel] [PATCH 14/26] hostfs: remove unnecessary dentry_unhash on rmdir, dir rename
@ 2011-05-27 20:42 ` Sage Weil
0 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:42 UTC (permalink / raw)
To: hch, viro
Cc: linux-fsdevel, Sage Weil, Jeff Dike, user-mode-linux-devel,
Richard Weinberger
hostfs does not have problems with references to unlinked directories.
CC: Jeff Dike <jdike@addtoit.com>
CC: Richard Weinberger <richard@nod.at>
CC: user-mode-linux-devel@lists.sourceforge.net
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/hostfs/hostfs_kern.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index e6816b9..2638c83 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -683,8 +683,6 @@ int hostfs_rmdir(struct inode *ino, struct dentry *dentry)
char *file;
int err;
- dentry_unhash(dentry);
-
if ((file = dentry_name(dentry)) == NULL)
return -ENOMEM;
err = do_rmdir(file);
@@ -738,9 +736,6 @@ int hostfs_rename(struct inode *from_ino, struct dentry *from,
char *from_name, *to_name;
int err;
- if (to->d_inode && S_ISDIR(to->d_inode->i_mode))
- dentry_unhash(to);
-
if ((from_name = dentry_name(from)) == NULL)
return -ENOMEM;
if ((to_name = dentry_name(to)) == NULL) {
--
1.7.0
------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 15/26] ecryptfs: remove unnecessary dentry_unhash on rmdir, dir rename
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
` (13 preceding siblings ...)
2011-05-27 20:42 ` [uml-devel] " Sage Weil
@ 2011-05-27 20:42 ` Sage Weil
2011-05-27 20:42 ` [PATCH 16/26] ncpfs: document dentry_unhash usage Sage Weil
` (10 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:42 UTC (permalink / raw)
To: hch, viro
Cc: linux-fsdevel, Sage Weil, Tyler Hicks, Dustin Kirkland, ecryptfs-devel
ecryptfs does not have problems with references to unlinked directories.
CC: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
CC: Dustin Kirkland <kirkland@canonical.com>
CC: ecryptfs-devel@lists.launchpad.net
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/ecryptfs/inode.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index 227b409..4d4cc6a 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -521,8 +521,6 @@ static int ecryptfs_rmdir(struct inode *dir, struct dentry *dentry)
struct dentry *lower_dir_dentry;
int rc;
- dentry_unhash(dentry);
-
lower_dentry = ecryptfs_dentry_to_lower(dentry);
dget(dentry);
lower_dir_dentry = lock_parent(lower_dentry);
@@ -573,9 +571,6 @@ ecryptfs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct dentry *lower_new_dir_dentry;
struct dentry *trap = NULL;
- if (new_dentry->d_inode && S_ISDIR(new_dentry->d_inode->i_mode))
- dentry_unhash(new_dentry);
-
lower_old_dentry = ecryptfs_dentry_to_lower(old_dentry);
lower_new_dentry = ecryptfs_dentry_to_lower(new_dentry);
dget(lower_old_dentry);
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 16/26] ncpfs: document dentry_unhash usage
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
` (14 preceding siblings ...)
2011-05-27 20:42 ` [PATCH 15/26] ecryptfs: " Sage Weil
@ 2011-05-27 20:42 ` Sage Weil
2011-05-27 20:42 ` [PATCH 17/26] ncpfs: fix rename over directory with dangling references Sage Weil
` (9 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:42 UTC (permalink / raw)
To: hch, viro; +Cc: linux-fsdevel, Sage Weil, Petr Vandrovec, linux-kernel
ncpfs returns EBUSY if there are any references to the directory. The
dentry_unhash call only unhashes the dentry if there are no references.
CC: Petr Vandrovec <petr@vandrovec.name>
CC: linux-kernel@vger.kernel.org
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/ncpfs/dir.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c
index e3e646b..81c287d 100644
--- a/fs/ncpfs/dir.c
+++ b/fs/ncpfs/dir.c
@@ -1033,8 +1033,11 @@ static int ncp_rmdir(struct inode *dir, struct dentry *dentry)
DPRINTK("ncp_rmdir: removing %s/%s\n",
dentry->d_parent->d_name.name, dentry->d_name.name);
+ /*
+ * fail with EBUSY if there are still references to this
+ * directory.
+ */
dentry_unhash(dentry);
-
error = -EBUSY;
if (!d_unhashed(dentry))
goto out;
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 17/26] ncpfs: fix rename over directory with dangling references
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
` (15 preceding siblings ...)
2011-05-27 20:42 ` [PATCH 16/26] ncpfs: document dentry_unhash usage Sage Weil
@ 2011-05-27 20:42 ` Sage Weil
2011-05-27 20:42 ` [PATCH 18/26] 9p: remove unnecessary dentry_unhash on rmdir, dir rename Sage Weil
` (8 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:42 UTC (permalink / raw)
To: hch, viro; +Cc: linux-fsdevel, Sage Weil, Petr Vandrovec, linux-kernel
ncpfs does not handle references to unlinked directories (or so it would
seem given the ncp_rmdir check). Since it is also possible to rename over
an empty directory, perform the same check here.
CC: Petr Vandrovec <petr@vandrovec.name>
CC: linux-kernel@vger.kernel.org
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/ncpfs/dir.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c
index 81c287d..9c51f62 100644
--- a/fs/ncpfs/dir.c
+++ b/fs/ncpfs/dir.c
@@ -1144,8 +1144,16 @@ static int ncp_rename(struct inode *old_dir, struct dentry *old_dentry,
old_dentry->d_parent->d_name.name, old_dentry->d_name.name,
new_dentry->d_parent->d_name.name, new_dentry->d_name.name);
- if (new_dentry->d_inode && S_ISDIR(new_dentry->d_inode->i_mode))
+ if (new_dentry->d_inode && S_ISDIR(new_dentry->d_inode->i_mode)) {
+ /*
+ * fail with EBUSY if there are still references to this
+ * directory.
+ */
dentry_unhash(new_dentry);
+ error = -EBUSY;
+ if (!d_unhashed(new_dentry))
+ goto out;
+ }
ncp_age_dentry(server, old_dentry);
ncp_age_dentry(server, new_dentry);
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 18/26] 9p: remove unnecessary dentry_unhash on rmdir, dir rename
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
` (16 preceding siblings ...)
2011-05-27 20:42 ` [PATCH 17/26] ncpfs: fix rename over directory with dangling references Sage Weil
@ 2011-05-27 20:42 ` Sage Weil
2011-05-27 20:42 ` [PATCH 19/26] affs: " Sage Weil
` (7 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:42 UTC (permalink / raw)
To: hch, viro
Cc: linux-fsdevel, Sage Weil, Eric Van Hensbergen, Ron Minnich,
Latchesar Ionkov, v9fs-developer
9p has no problems with references to unlinked directories.
CC: Eric Van Hensbergen <ericvh@gmail.com>
CC: Ron Minnich <rminnich@sandia.gov>
CC: Latchesar Ionkov <lucho@ionkov.net>
CC: v9fs-developer@lists.sourceforge.net
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/9p/vfs_inode.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 8d7f3e6..7f6c677 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -814,7 +814,6 @@ int v9fs_vfs_unlink(struct inode *i, struct dentry *d)
int v9fs_vfs_rmdir(struct inode *i, struct dentry *d)
{
- dentry_unhash(d);
return v9fs_remove(i, d, 1);
}
@@ -840,9 +839,6 @@ v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct p9_fid *newdirfid;
struct p9_wstat wstat;
- if (new_dentry->d_inode && S_ISDIR(new_dentry->d_inode->i_mode))
- dentry_unhash(new_dentry);
-
P9_DPRINTK(P9_DEBUG_VFS, "\n");
retval = 0;
old_inode = old_dentry->d_inode;
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 19/26] affs: remove unnecessary dentry_unhash on rmdir, dir rename
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
` (17 preceding siblings ...)
2011-05-27 20:42 ` [PATCH 18/26] 9p: remove unnecessary dentry_unhash on rmdir, dir rename Sage Weil
@ 2011-05-27 20:42 ` Sage Weil
2011-05-27 20:42 ` [PATCH 20/26] afs: " Sage Weil
` (6 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:42 UTC (permalink / raw)
To: hch, viro; +Cc: linux-fsdevel, Sage Weil
affs has no problems with references to unlinked directories.
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/affs/namei.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/fs/affs/namei.c b/fs/affs/namei.c
index 03330e2..e3e9efc 100644
--- a/fs/affs/namei.c
+++ b/fs/affs/namei.c
@@ -320,8 +320,6 @@ affs_rmdir(struct inode *dir, struct dentry *dentry)
dentry->d_inode->i_ino,
(int)dentry->d_name.len, dentry->d_name.name);
- dentry_unhash(dentry);
-
return affs_remove_header(dentry);
}
@@ -419,9 +417,6 @@ affs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct buffer_head *bh = NULL;
int retval;
- if (new_dentry->d_inode && S_ISDIR(new_dentry->d_inode->i_mode))
- dentry_unhash(new_dentry);
-
pr_debug("AFFS: rename(old=%u,\"%*s\" to new=%u,\"%*s\")\n",
(u32)old_dir->i_ino, (int)old_dentry->d_name.len, old_dentry->d_name.name,
(u32)new_dir->i_ino, (int)new_dentry->d_name.len, new_dentry->d_name.name);
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 20/26] afs: remove unnecessary dentry_unhash on rmdir, dir rename
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
` (18 preceding siblings ...)
2011-05-27 20:42 ` [PATCH 19/26] affs: " Sage Weil
@ 2011-05-27 20:42 ` Sage Weil
2011-05-27 20:42 ` [PATCH 21/26] coda: " Sage Weil
` (5 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:42 UTC (permalink / raw)
To: hch, viro; +Cc: linux-fsdevel, Sage Weil, David Howells, linux-afs
afs has no problems with references to unlinked directories.
CC: David Howells <dhowells@redhat.com>
CC: linux-afs@lists.infradead.org
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/afs/dir.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index 2c4e051..20c106f 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -845,8 +845,6 @@ static int afs_rmdir(struct inode *dir, struct dentry *dentry)
_enter("{%x:%u},{%s}",
dvnode->fid.vid, dvnode->fid.vnode, dentry->d_name.name);
- dentry_unhash(dentry);
-
ret = -ENAMETOOLONG;
if (dentry->d_name.len >= AFSNAMEMAX)
goto error;
@@ -1148,9 +1146,6 @@ static int afs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct key *key;
int ret;
- if (new_dentry->d_inode && S_ISDIR(new_dentry->d_inode->i_mode))
- dentry_unhash(new_dentry);
-
vnode = AFS_FS_I(old_dentry->d_inode);
orig_dvnode = AFS_FS_I(old_dir);
new_dvnode = AFS_FS_I(new_dir);
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 21/26] coda: remove unnecessary dentry_unhash on rmdir, dir rename
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
` (19 preceding siblings ...)
2011-05-27 20:42 ` [PATCH 20/26] afs: " Sage Weil
@ 2011-05-27 20:42 ` Sage Weil
2011-05-27 20:42 ` [PATCH 22/26] fuse: " Sage Weil
` (4 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:42 UTC (permalink / raw)
To: hch, viro; +Cc: linux-fsdevel, Sage Weil, Jan Harkes, coda, codalist
Coda has no problems with references to unlinked directories.
CC: Jan Harkes <jaharkes@cs.cmu.edu>
CC: coda@cs.cmu.edu
CC: codalist@coda.cs.cmu.edu
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/coda/dir.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/fs/coda/dir.c b/fs/coda/dir.c
index a46126f..2b8dae4 100644
--- a/fs/coda/dir.c
+++ b/fs/coda/dir.c
@@ -336,8 +336,6 @@ static int coda_rmdir(struct inode *dir, struct dentry *de)
int len = de->d_name.len;
int error;
- dentry_unhash(de);
-
error = venus_rmdir(dir->i_sb, coda_i2f(dir), name, len);
if (!error) {
/* VFS may delete the child */
@@ -361,9 +359,6 @@ static int coda_rename(struct inode *old_dir, struct dentry *old_dentry,
int new_length = new_dentry->d_name.len;
int error;
- if (new_dentry->d_inode && S_ISDIR(new_dentry->d_inode->i_mode))
- dentry_unhash(new_dentry);
-
error = venus_rename(old_dir->i_sb, coda_i2f(old_dir),
coda_i2f(new_dir), old_length, new_length,
(const char *) old_name, (const char *)new_name);
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 22/26] fuse: remove unnecessary dentry_unhash on rmdir, dir rename
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
` (20 preceding siblings ...)
2011-05-27 20:42 ` [PATCH 21/26] coda: " Sage Weil
@ 2011-05-27 20:42 ` Sage Weil
2011-05-27 20:42 ` [PATCH 23/26] minix: " Sage Weil
` (3 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:42 UTC (permalink / raw)
To: hch, viro; +Cc: linux-fsdevel, Sage Weil, Miklos Szeredi, fuse-devel
Fuse has no problems with references to unlinked directories.
CC: Miklos Szeredi <miklos@szeredi.hu>
CC: fuse-devel@lists.sourceforge.net
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/fuse/dir.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 0d0e3fa..d501607 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -667,8 +667,6 @@ static int fuse_rmdir(struct inode *dir, struct dentry *entry)
if (IS_ERR(req))
return PTR_ERR(req);
- dentry_unhash(entry);
-
req->in.h.opcode = FUSE_RMDIR;
req->in.h.nodeid = get_node_id(dir);
req->in.numargs = 1;
@@ -694,9 +692,6 @@ static int fuse_rename(struct inode *olddir, struct dentry *oldent,
struct fuse_conn *fc = get_fuse_conn(olddir);
struct fuse_req *req = fuse_get_req(fc);
- if (newent->d_inode && S_ISDIR(newent->d_inode->i_mode))
- dentry_unhash(newent);
-
if (IS_ERR(req))
return PTR_ERR(req);
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 23/26] minix: remove unnecessary dentry_unhash on rmdir, dir rename
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
` (21 preceding siblings ...)
2011-05-27 20:42 ` [PATCH 22/26] fuse: " Sage Weil
@ 2011-05-27 20:42 ` Sage Weil
2011-05-27 20:42 ` [PATCH 24/26] hpfs: " Sage Weil
` (2 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:42 UTC (permalink / raw)
To: hch, viro; +Cc: linux-fsdevel, Sage Weil
Minix has no issues with references to unlinked directories.
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/minix/namei.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/fs/minix/namei.c b/fs/minix/namei.c
index f60aed8..6e6777f 100644
--- a/fs/minix/namei.c
+++ b/fs/minix/namei.c
@@ -168,8 +168,6 @@ static int minix_rmdir(struct inode * dir, struct dentry *dentry)
struct inode * inode = dentry->d_inode;
int err = -ENOTEMPTY;
- dentry_unhash(dentry);
-
if (minix_empty_dir(inode)) {
err = minix_unlink(dir, dentry);
if (!err) {
@@ -192,9 +190,6 @@ static int minix_rename(struct inode * old_dir, struct dentry *old_dentry,
struct minix_dir_entry * old_de;
int err = -ENOENT;
- if (new_inode && S_ISDIR(new_inode->i_mode))
- dentry_unhash(new_dentry);
-
old_de = minix_find_entry(old_dentry, &old_page);
if (!old_de)
goto out;
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 24/26] hpfs: remove unnecessary dentry_unhash on rmdir, dir rename
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
` (22 preceding siblings ...)
2011-05-27 20:42 ` [PATCH 23/26] minix: " Sage Weil
@ 2011-05-27 20:42 ` Sage Weil
2011-05-27 20:42 ` [PATCH 25/26] fat: " Sage Weil
2011-05-27 20:42 ` [PATCH 26/26] configfs: " Sage Weil
25 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:42 UTC (permalink / raw)
To: hch, viro; +Cc: linux-fsdevel, Sage Weil, Mikulas Patocka
Hpfs has no problems with references to unlinked directories.
We leave one dentry_unhash call in place, in hpfs_unlink's strange path
where it tries to truncate a file because the disk is full. I'm not sure
what the full story is there.
CC: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/hpfs/namei.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c
index ff0ce21..acf95da 100644
--- a/fs/hpfs/namei.c
+++ b/fs/hpfs/namei.c
@@ -439,8 +439,6 @@ static int hpfs_rmdir(struct inode *dir, struct dentry *dentry)
int err;
int r;
- dentry_unhash(dentry);
-
hpfs_adjust_length(name, &len);
hpfs_lock(dir->i_sb);
err = -ENOENT;
@@ -535,9 +533,6 @@ static int hpfs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct fnode *fnode;
int err;
- if (new_inode && S_ISDIR(new_inode->i_mode))
- dentry_unhash(new_dentry);
-
if ((err = hpfs_chk_name(new_name, &new_len))) return err;
err = 0;
hpfs_adjust_length(old_name, &old_len);
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 25/26] fat: remove unnecessary dentry_unhash on rmdir, dir rename
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
` (23 preceding siblings ...)
2011-05-27 20:42 ` [PATCH 24/26] hpfs: " Sage Weil
@ 2011-05-27 20:42 ` Sage Weil
2011-05-28 6:37 ` OGAWA Hirofumi
2011-05-27 20:42 ` [PATCH 26/26] configfs: " Sage Weil
25 siblings, 1 reply; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:42 UTC (permalink / raw)
To: hch, viro; +Cc: linux-fsdevel, Sage Weil, OGAWA Hirofumi
fat does not have problems with references to unlinked directories.
CC: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/fat/namei_msdos.c | 5 -----
fs/fat/namei_vfat.c | 5 -----
2 files changed, 0 insertions(+), 10 deletions(-)
diff --git a/fs/fat/namei_msdos.c b/fs/fat/namei_msdos.c
index be15437..3b222da 100644
--- a/fs/fat/namei_msdos.c
+++ b/fs/fat/namei_msdos.c
@@ -326,8 +326,6 @@ static int msdos_rmdir(struct inode *dir, struct dentry *dentry)
struct fat_slot_info sinfo;
int err;
- dentry_unhash(dentry);
-
lock_super(sb);
/*
* Check whether the directory is not in use, then check
@@ -459,9 +457,6 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name,
old_inode = old_dentry->d_inode;
new_inode = new_dentry->d_inode;
- if (new_inode && S_ISDIR(new_inode->i_mode))
- dentry_unhash(new_dentry);
-
err = fat_scan(old_dir, old_name, &old_sinfo);
if (err) {
err = -EIO;
diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c
index c61a678..20b4ea5 100644
--- a/fs/fat/namei_vfat.c
+++ b/fs/fat/namei_vfat.c
@@ -824,8 +824,6 @@ static int vfat_rmdir(struct inode *dir, struct dentry *dentry)
struct fat_slot_info sinfo;
int err;
- dentry_unhash(dentry);
-
lock_super(sb);
err = fat_dir_empty(inode);
@@ -933,9 +931,6 @@ static int vfat_rename(struct inode *old_dir, struct dentry *old_dentry,
int err, is_dir, update_dotdot, corrupt = 0;
struct super_block *sb = old_dir->i_sb;
- if (new_dentry->d_inode && S_ISDIR(new_dentry->d_inode->i_mode))
- dentry_unhash(new_dentry);
-
old_sinfo.bh = sinfo.bh = dotdot_bh = NULL;
old_inode = old_dentry->d_inode;
new_inode = new_dentry->d_inode;
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 26/26] configfs: remove unnecessary dentry_unhash on rmdir, dir rename
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
` (24 preceding siblings ...)
2011-05-27 20:42 ` [PATCH 25/26] fat: " Sage Weil
@ 2011-05-27 20:42 ` Sage Weil
25 siblings, 0 replies; 32+ messages in thread
From: Sage Weil @ 2011-05-27 20:42 UTC (permalink / raw)
To: hch, viro; +Cc: linux-fsdevel, Sage Weil, Joel Becker
configfs does not have problems with references to unlinked directories.
CC: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/configfs/dir.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c
index 9d17d35..9a37a9b 100644
--- a/fs/configfs/dir.c
+++ b/fs/configfs/dir.c
@@ -1359,8 +1359,6 @@ static int configfs_rmdir(struct inode *dir, struct dentry *dentry)
struct module *subsys_owner = NULL, *dead_item_owner = NULL;
int ret;
- dentry_unhash(dentry);
-
if (dentry->d_parent == configfs_sb->s_root)
return -EPERM;
--
1.7.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* Re: [PATCH 25/26] fat: remove unnecessary dentry_unhash on rmdir, dir rename
2011-05-27 20:42 ` [PATCH 25/26] fat: " Sage Weil
@ 2011-05-28 6:37 ` OGAWA Hirofumi
0 siblings, 0 replies; 32+ messages in thread
From: OGAWA Hirofumi @ 2011-05-28 6:37 UTC (permalink / raw)
To: Sage Weil; +Cc: hch, viro, linux-fsdevel
Sage Weil <sage@newdream.net> writes:
> fat does not have problems with references to unlinked directories.
>
> CC: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
> Signed-off-by: Sage Weil <sage@newdream.net>
Looks good to me.
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Feel free to add if needed. And please just send it directly to Linus.
Thanks.
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 10/26] udf: remove unnecessary dentry_unhash from rmdir, dir rename
2011-05-27 20:42 ` [PATCH 10/26] udf: " Sage Weil
@ 2011-05-30 9:43 ` Jan Kara
0 siblings, 0 replies; 32+ messages in thread
From: Jan Kara @ 2011-05-30 9:43 UTC (permalink / raw)
To: Sage Weil; +Cc: hch, viro, linux-fsdevel, Jan Kara
On Fri 27-05-11 13:42:03, Sage Weil wrote:
> udf does not have problems with references to unlinked directories.
Acked-by: Jan Kara <jack@suse.cz>
> CC: Jan Kara <jack@suse.cz>
> Signed-off-by: Sage Weil <sage@newdream.net>
> ---
> fs/udf/namei.c | 5 -----
> 1 files changed, 0 insertions(+), 5 deletions(-)
>
> diff --git a/fs/udf/namei.c b/fs/udf/namei.c
> index 4d76594..f1dce84 100644
> --- a/fs/udf/namei.c
> +++ b/fs/udf/namei.c
> @@ -783,8 +783,6 @@ static int udf_rmdir(struct inode *dir, struct dentry *dentry)
> struct fileIdentDesc *fi, cfi;
> struct kernel_lb_addr tloc;
>
> - dentry_unhash(dentry);
> -
> retval = -ENOENT;
> fi = udf_find_entry(dir, &dentry->d_name, &fibh, &cfi);
> if (!fi)
> @@ -1083,9 +1081,6 @@ static int udf_rename(struct inode *old_dir, struct dentry *old_dentry,
> struct kernel_lb_addr tloc;
> struct udf_inode_info *old_iinfo = UDF_I(old_inode);
>
> - if (new_inode && S_ISDIR(new_inode->i_mode))
> - dentry_unhash(new_dentry);
> -
> ofi = udf_find_entry(old_dir, &old_dentry->d_name, &ofibh, &ocfi);
> if (ofi) {
> if (ofibh.sbh != ofibh.ebh)
> --
> 1.7.0
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 11/26] omfs: remove unnecessary dentry_unhash on rmdir, dir rneame
2011-05-27 20:42 ` [PATCH 11/26] omfs: remove unnecessary dentry_unhash on rmdir, dir rneame Sage Weil
@ 2011-06-05 0:42 ` Bob Copeland
0 siblings, 0 replies; 32+ messages in thread
From: Bob Copeland @ 2011-06-05 0:42 UTC (permalink / raw)
To: Sage Weil; +Cc: hch, viro, linux-fsdevel, linux-karma-devel
On Fri, May 27, 2011 at 01:42:04PM -0700, Sage Weil wrote:
> omfs does not have problems with references to unlinked directories.
Sorry, on vacation last week and disconnected. Agreed...
Acked-by: Bob Copeland <me@bobcopeland.com>
--
Bob Copeland %% www.bobcopeland.com
^ permalink raw reply [flat|nested] 32+ messages in thread
end of thread, other threads:[~2011-06-05 1:14 UTC | newest]
Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-27 20:41 [PATCH 00/26] Some final dentry_unhash cleanup Sage Weil
2011-05-27 20:41 ` [PATCH 01/26] bfs: remove unnecessary dentry_unhash on dir rename Sage Weil
2011-05-27 20:41 ` [PATCH 02/26] sysv: remove unnecessary dentry_unhash from rmdir, " Sage Weil
2011-05-27 20:41 ` [PATCH 03/26] jffs2: " Sage Weil
2011-05-27 20:41 ` [PATCH 04/26] jfs: " Sage Weil
2011-05-27 20:41 ` [PATCH 05/26] logfs: " Sage Weil
[not found] ` <1306528939-30636-1-git-send-email-sage-BnTBU8nroG7k1uMJSBkQmQ@public.gmane.org>
2011-05-27 20:41 ` [PATCH 06/26] nilfs2: " Sage Weil
2011-05-27 20:42 ` [PATCH 07/26] ubifs: " Sage Weil
2011-05-27 20:42 ` Sage Weil
2011-05-27 20:42 ` [PATCH 08/26] ufs: " Sage Weil
2011-05-27 20:42 ` [PATCH 09/26] reiserfs: " Sage Weil
2011-05-27 20:42 ` [PATCH 10/26] udf: " Sage Weil
2011-05-30 9:43 ` Jan Kara
2011-05-27 20:42 ` [PATCH 11/26] omfs: remove unnecessary dentry_unhash on rmdir, dir rneame Sage Weil
2011-06-05 0:42 ` Bob Copeland
2011-05-27 20:42 ` [PATCH 12/26] hfs: remove unnecessary dentry_unhash on rmdir, dir rename Sage Weil
2011-05-27 20:42 ` [PATCH 13/26] hfsplus: " Sage Weil
2011-05-27 20:42 ` [PATCH 14/26] hostfs: " Sage Weil
2011-05-27 20:42 ` [uml-devel] " Sage Weil
2011-05-27 20:42 ` [PATCH 15/26] ecryptfs: " Sage Weil
2011-05-27 20:42 ` [PATCH 16/26] ncpfs: document dentry_unhash usage Sage Weil
2011-05-27 20:42 ` [PATCH 17/26] ncpfs: fix rename over directory with dangling references Sage Weil
2011-05-27 20:42 ` [PATCH 18/26] 9p: remove unnecessary dentry_unhash on rmdir, dir rename Sage Weil
2011-05-27 20:42 ` [PATCH 19/26] affs: " Sage Weil
2011-05-27 20:42 ` [PATCH 20/26] afs: " Sage Weil
2011-05-27 20:42 ` [PATCH 21/26] coda: " Sage Weil
2011-05-27 20:42 ` [PATCH 22/26] fuse: " Sage Weil
2011-05-27 20:42 ` [PATCH 23/26] minix: " Sage Weil
2011-05-27 20:42 ` [PATCH 24/26] hpfs: " Sage Weil
2011-05-27 20:42 ` [PATCH 25/26] fat: " Sage Weil
2011-05-28 6:37 ` OGAWA Hirofumi
2011-05-27 20:42 ` [PATCH 26/26] configfs: " Sage Weil
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.