[PATCH] r/o bind mounts: monitor zeroing of i_nlink

Some filesystems, instead of simply decrementing i_nlink, simply zero it
during an unlink operation.  We need to catch these in addition to the
decrement operations.

Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Dave Hansen
2006-09-30 23:29:06 -07:00
committed by Linus Torvalds
parent 17ff785691
commit ce71ec3684
15 changed files with 26 additions and 21 deletions

View File

@ -638,7 +638,7 @@ static int autofs4_dir_unlink(struct inode *dir, struct dentry *dentry)
dput(ino->dentry);
dentry->d_inode->i_size = 0;
dentry->d_inode->i_nlink = 0;
clear_nlink(dentry->d_inode);
dir->i_mtime = CURRENT_TIME;
@ -673,7 +673,7 @@ static int autofs4_dir_rmdir(struct inode *dir, struct dentry *dentry)
}
dput(ino->dentry);
dentry->d_inode->i_size = 0;
dentry->d_inode->i_nlink = 0;
clear_nlink(dentry->d_inode);
if (dir->i_nlink)
drop_nlink(dir);