aboutsummaryrefslogtreecommitdiffstats
path: root/fs/autofs4/root.c
diff options
context:
space:
mode:
authorDave Hansen <haveblue@us.ibm.com>2006-10-01 02:29:06 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-01 03:39:30 -0400
commitce71ec36840368b877fb63bd14c8e67ab62d08b1 (patch)
tree55ea3caaa339881dfd66d787b3dbbb964825d07a /fs/autofs4/root.c
parent17ff785691503f63ec648df82a7fdaece7695561 (diff)
[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>
Diffstat (limited to 'fs/autofs4/root.c')
-rw-r--r--fs/autofs4/root.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index e21bb4668201..c1493524da4d 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -638,7 +638,7 @@ static int autofs4_dir_unlink(struct inode *dir, struct dentry *dentry)
638 dput(ino->dentry); 638 dput(ino->dentry);
639 639
640 dentry->d_inode->i_size = 0; 640 dentry->d_inode->i_size = 0;
641 dentry->d_inode->i_nlink = 0; 641 clear_nlink(dentry->d_inode);
642 642
643 dir->i_mtime = CURRENT_TIME; 643 dir->i_mtime = CURRENT_TIME;
644 644
@@ -673,7 +673,7 @@ static int autofs4_dir_rmdir(struct inode *dir, struct dentry *dentry)
673 } 673 }
674 dput(ino->dentry); 674 dput(ino->dentry);
675 dentry->d_inode->i_size = 0; 675 dentry->d_inode->i_size = 0;
676 dentry->d_inode->i_nlink = 0; 676 clear_nlink(dentry->d_inode);
677 677
678 if (dir->i_nlink) 678 if (dir->i_nlink)
679 drop_nlink(dir); 679 drop_nlink(dir);