diff options
author | Dave Hansen <haveblue@us.ibm.com> | 2006-10-01 02:29:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-01 03:39:30 -0400 |
commit | 9a53c3a783c2fa9b969628e65695c11c3e51e673 (patch) | |
tree | 5a6115e18ee105246d46e3db3d5b07749d232f5b /fs/ocfs2/namei.c | |
parent | aab520e2f6c80160cabd187a8d0292d1cec8ff68 (diff) |
[PATCH] r/o bind mounts: unlink: monitor i_nlink
When a filesystem decrements i_nlink to zero, it means that a write must be
performed in order to drop the inode from the filesystem.
We're shortly going to have keep filesystems from being remounted r/o between
the time that this i_nlink decrement and that write occurs.
So, add a little helper function to do the decrements. We'll tie into it in a
bit to note when i_nlink hits zero.
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/ocfs2/namei.c')
-rw-r--r-- | fs/ocfs2/namei.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 849c3b4bb94a..40f83f53053a 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c | |||
@@ -739,7 +739,7 @@ static int ocfs2_link(struct dentry *old_dentry, | |||
739 | err = ocfs2_journal_dirty(handle, fe_bh); | 739 | err = ocfs2_journal_dirty(handle, fe_bh); |
740 | if (err < 0) { | 740 | if (err < 0) { |
741 | le16_add_cpu(&fe->i_links_count, -1); | 741 | le16_add_cpu(&fe->i_links_count, -1); |
742 | inode->i_nlink--; | 742 | drop_nlink(inode); |
743 | mlog_errno(err); | 743 | mlog_errno(err); |
744 | goto bail; | 744 | goto bail; |
745 | } | 745 | } |
@@ -749,7 +749,7 @@ static int ocfs2_link(struct dentry *old_dentry, | |||
749 | parent_fe_bh, de_bh); | 749 | parent_fe_bh, de_bh); |
750 | if (err) { | 750 | if (err) { |
751 | le16_add_cpu(&fe->i_links_count, -1); | 751 | le16_add_cpu(&fe->i_links_count, -1); |
752 | inode->i_nlink--; | 752 | drop_nlink(inode); |
753 | mlog_errno(err); | 753 | mlog_errno(err); |
754 | goto bail; | 754 | goto bail; |
755 | } | 755 | } |