diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-07-22 09:12:56 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-07-30 02:17:03 -0400 |
commit | f0947e5ccedb749b2f701aa5279cd8f848a720a1 (patch) | |
tree | c2c2f6fd66b2aac9d4d6d55f7cc23cd9790305e5 /fs | |
parent | 1cd14cafc694bcedc5017a4f0dcb3c3faddec622 (diff) |
f2fs: fix i_name during f2fs_sync_file
As similar as the i_pino fix, i_name also should be fixed when i_nlink is 1.
The errorneous scenario is like this.
1. touch test1
2. link test1 test2
3. unlink test2
4. fsync test1
After this, i_name should be test1.
CC: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/f2fs/file.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 65ca3b3e5806..c2deb27ffb72 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c | |||
@@ -112,11 +112,13 @@ static int get_parent_ino(struct inode *inode, nid_t *pino) | |||
112 | if (!dentry) | 112 | if (!dentry) |
113 | return 0; | 113 | return 0; |
114 | 114 | ||
115 | inode = igrab(dentry->d_parent->d_inode); | 115 | if (update_dent_inode(inode, &dentry->d_name)) { |
116 | dput(dentry); | 116 | dput(dentry); |
117 | return 0; | ||
118 | } | ||
117 | 119 | ||
118 | *pino = inode->i_ino; | 120 | *pino = parent_ino(dentry); |
119 | iput(inode); | 121 | dput(dentry); |
120 | return 1; | 122 | return 1; |
121 | } | 123 | } |
122 | 124 | ||