diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-07-18 13:02:31 +0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-07-30 10:17:03 +0400 |
commit | 1cd14cafc694bcedc5017a4f0dcb3c3faddec622 (patch) | |
tree | 367eb533ab6475ccec4f809f7117fc845a64abbe /fs/f2fs/namei.c | |
parent | 4559071063270999d016c92a0b9241692cbbb522 (diff) | |
download | linux-1cd14cafc694bcedc5017a4f0dcb3c3faddec622.tar.xz |
f2fs: update file name in the inode block during f2fs_rename
The error is reproducible by:
0. mkfs.f2fs /dev/sdb1 & mount
1. touch test1
2. touch test2
3. mv test1 test2
4. umount
5. dumpt.f2fs -i 4 /dev/sdb1
After this, when we retrieve the inode->i_name of test2 by dump.f2fs, we get
test1 instead of test2.
This is because f2fs didn't update the file name during the f2fs_rename.
So, this patch fixes that.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/namei.c')
-rw-r--r-- | fs/f2fs/namei.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 64c07169df05..32972787f12f 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -427,6 +427,11 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry, if (!new_entry) goto out_dir; + if (update_dent_inode(old_inode, &new_dentry->d_name)) { + f2fs_put_page(new_page, 1); + goto out_dir; + } + f2fs_set_link(new_dir, new_entry, new_page, old_inode); new_inode->i_ctime = CURRENT_TIME; |