diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-07-22 22:12:56 +0900 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-18 11:43:54 +0900 |
commit | 9316685f5fab1d480dcbbd2a728d9eb215f0794f (patch) | |
tree | 454925aaa8acf407e867e307c704ae2d140167f6 /fs | |
parent | 6edcc5dfb3f327cbf8a660ec34a834346eb5d5a7 (diff) | |
download | linux-3.10-9316685f5fab1d480dcbbd2a728d9eb215f0794f.tar.gz linux-3.10-9316685f5fab1d480dcbbd2a728d9eb215f0794f.tar.bz2 linux-3.10-9316685f5fab1d480dcbbd2a728d9eb215f0794f.zip |
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 65ca3b3e580..c2deb27ffb7 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) if (!dentry) return 0; - inode = igrab(dentry->d_parent->d_inode); - dput(dentry); + if (update_dent_inode(inode, &dentry->d_name)) { + dput(dentry); + return 0; + } - *pino = inode->i_ino; - iput(inode); + *pino = parent_ino(dentry); + dput(dentry); return 1; } |