Skip to contentSkip to conversation

udf: update ctime and mtime of new_dir

PATCH In review Taesoo Kim 2 participants 2 messages Mar 24, 2015 – Apr 1, 2015 UDF filesystem

lore
Share & tools
lore

Taesoo Kim

author
#0 lore raw

PATCH 1/1 udf: update ctime and mtime of new_dir

Upon successful rename(), update ctime and mtime of new_dir as posix specifies.

---
 fs/udf/namei.c | 2 ++
 1 file changed, 2 insertions(+)
fs/udf/namei.c +2 -0
index 33b246b..eca1955 100644
@@ -1144,6 +1144,8 @@ static int udf_rename(struct inode *old_dir, struct dentry *old_dentry,
 			inode_dec_link_count(new_inode);
 		else {
 			inc_nlink(new_dir);
+			new_dir->i_ctime = new_dir->i_mtime
+				= current_fs_time(new_dir->i_sb);
 			mark_inode_dirty(new_dir);
 		}
 	}
Signature · 1 line
2.3.3
#1 lore raw
Quoted 4 lines · Taesoo Kim

Upon successful rename(), update ctime and mtime of new_dir as posix specifies.

Thanks for spotting the problem! But you apparently didn't test the patch
because it doesn't fix the problem - you've placed the timestamp update into a wrong branch. Please test the patches before you send them.

I've fixed the problem together with similar issues during file creation, link, etc.

Honza

Quoted 20 lines
---
 fs/udf/namei.c | 2 ++
 1 file changed, 2 insertions(+)
fs/udf/namei.c +2 -0
index 33b246b..eca1955 100644
@@ -1144,6 +1144,8 @@ static int udf_rename(struct inode *old_dir, struct dentry *old_dentry,
 			inode_dec_link_count(new_inode);
 		else {
 			inc_nlink(new_dir);
+			new_dir->i_ctime = new_dir->i_mtime
+				= current_fs_time(new_dir->i_sb);
 			mark_inode_dirty(new_dir);
 		}
 	}
Signature · 1 line
2.3.3
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR