diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-06-16 07:56:23 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-06-16 08:08:34 +0200 |
commit | 70d45cdb664390a5573c05f1eecc8432dcc6581b (patch) | |
tree | 6ab7b1d46459aa7c872a156d36ffc6416e8c9464 /fs/ufs/namei.c | |
parent | ufs: don't bother with lock_ufs()/unlock_ufs() for directory access (diff) | |
download | linux-70d45cdb664390a5573c05f1eecc8432dcc6581b.tar.xz linux-70d45cdb664390a5573c05f1eecc8432dcc6581b.zip |
ufs: don't touch mtime/ctime of directory being moved
See "ext2: Do not update mtime of a moved directory" (and followup in
"ext2: fix unbalanced kmap()/kunmap()") for background; this is UFS
equivalent - the same problem exists here.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ufs/namei.c')
-rw-r--r-- | fs/ufs/namei.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c index 3429079c11e2..d3fdfa22add5 100644 --- a/fs/ufs/namei.c +++ b/fs/ufs/namei.c @@ -276,7 +276,7 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry, new_de = ufs_find_entry(new_dir, &new_dentry->d_name, &new_page); if (!new_de) goto out_dir; - ufs_set_link(new_dir, new_de, new_page, old_inode); + ufs_set_link(new_dir, new_de, new_page, old_inode, 1); new_inode->i_ctime = CURRENT_TIME_SEC; if (dir_de) drop_nlink(new_inode); @@ -299,7 +299,12 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry, mark_inode_dirty(old_inode); if (dir_de) { - ufs_set_link(old_inode, dir_de, dir_page, new_dir); + if (old_dir != new_dir) + ufs_set_link(old_inode, dir_de, dir_page, new_dir, 0); + else { + kunmap(dir_page); + page_cache_release(dir_page); + } inode_dec_link_count(old_dir); } return 0; |