Skip to contentSkip to conversation

ramfs needs to update directory m/ctime on symlink

PATCH New Peter Staubach 1 participant 1 message Mar 2, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ramfs needs to update directory m/ctime on symlink

Hi.

Attached is a patch which addresses a problem in ramfs where it neglects to update the directory mtime and ctime fields when creating a new symbolic link. Ramfs was modified in 2.6.15 to update these fields when other types of entries are created. The symlink support is separate from that other support, so that change did not cover quite all of the possibilities.

All of the directory content manipulation entry points now seem to be covered with respect to these time field updates.

Thanx...

ps

fs/ramfs/inode.c renamed from fs/ramfs/inode.c.org +1 -0
@@ -137,6 +137,7 @@ static int ramfs_symlink(struct inode * 
 				inode->i_gid = dir->i_gid;
 			d_instantiate(dentry, inode);
 			dget(dentry);
+			dir->i_mtime = dir->i_ctime = CURRENT_TIME;
 		} else
 			iput(inode);
 	}