* ncpfs [Regression] rmdir and rm -rf fail with device busy
@ 2013-05-14 15:23 Dave Chiluk
0 siblings, 0 replies; only message in thread
From: Dave Chiluk @ 2013-05-14 15:23 UTC (permalink / raw)
To: Petr Vandrovec, linux-kernel
Rmdir and or rm -rf are failing on an ncpfs mounted directory.
for example
root@precise:/mnt/ncp# mkdir a ; rmdir a
rmdir: failed to remove `a': Device or resource busy
I bisected the change that introduced the regression to .
commit 1d2ef5901483004d74947bbf78d5146c24038fe7 which follows.
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
diff --git a/fs/namei.c b/fs/namei.c
index b52bc68..f478836 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2616,6 +2616,7 @@ int vfs_rmdir(struct inode *dir, struct dentry
*dentry)
if (!dir->i_op->rmdir)
return -EPERM;
+ dget(dentry);
mutex_lock(&dentry->d_inode->i_mutex);
error = -EBUSY;
@@ -2636,6 +2637,7 @@ int vfs_rmdir(struct inode *dir, struct dentry
*dentry)
out:
mutex_unlock(&dentry->d_inode->i_mutex);
+ dput(dentry);
if (!error)
d_delete(dentry);
return error;
@@ -3025,6 +3027,7 @@ static int vfs_rename_dir(struct inode *old_dir,
struct dentry
if (error)
return error;
+ dget(new_dentry);
if (target)
mutex_lock(&target->i_mutex);
@@ -3045,6 +3048,7 @@ static int vfs_rename_dir(struct inode *old_dir,
struct dentry
out:
if (target)
mutex_unlock(&target->i_mutex);
+ dput(new_dentry);
if (!error)
if (!(old_dir->i_sb->s_type->fs_flags &
FS_RENAME_DOES_D_MOVE))
d_move(old_dentry,new_dentry);
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Unfortunately this looks like a good patch.
So I narrowed down the the error path to the following two lines
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c
index 8163260..5701aed 100644
--- a/fs/ncpfs/dir.c
+++ b/fs/ncpfs/dir.c
@@ -1035,8 +1035,6 @@ static int ncp_rmdir(struct inode *dir, struct
dentry *dentry)
*/
dentry_unhash(dentry);
error = -EBUSY;
- if (!d_unhashed(dentry))
- goto out;
len = sizeof(__name);
error = ncp_io2vol(server, __name, &len, dentry->d_name.name,
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
However these are necessary as without them, the directory can be
removed when it is actually in use.
So does anyone have any suggestions on how to fix this?
Thanks,
Dave.
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-05-14 15:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-14 15:23 ncpfs [Regression] rmdir and rm -rf fail with device busy Dave Chiluk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox