@@ -589,6 +589,7 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,
589589 dent -> nlen = cpu_to_le16 (fname_len (nm ));
590590 memcpy (dent -> name , fname_name (nm ), fname_len (nm ));
591591 dent -> name [fname_len (nm )] = '\0' ;
592+ dent -> cookie = prandom_u32 ();
592593
593594 zero_dent_node_unused (dent );
594595 ubifs_prep_grp_node (c , dent , dlen , 0 );
@@ -1124,6 +1125,7 @@ int ubifs_jnl_rename(struct ubifs_info *c, const struct inode *old_dir,
11241125 dent -> nlen = cpu_to_le16 (fname_len (new_nm ));
11251126 memcpy (dent -> name , fname_name (new_nm ), fname_len (new_nm ));
11261127 dent -> name [fname_len (new_nm )] = '\0' ;
1128+ dent -> cookie = prandom_u32 ();
11271129 zero_dent_node_unused (dent );
11281130 ubifs_prep_grp_node (c , dent , dlen1 , 0 );
11291131
@@ -1142,6 +1144,7 @@ int ubifs_jnl_rename(struct ubifs_info *c, const struct inode *old_dir,
11421144 dent2 -> nlen = cpu_to_le16 (fname_len (old_nm ));
11431145 memcpy (dent2 -> name , fname_name (old_nm ), fname_len (old_nm ));
11441146 dent2 -> name [fname_len (old_nm )] = '\0' ;
1147+ dent2 -> cookie = prandom_u32 ();
11451148 zero_dent_node_unused (dent2 );
11461149 ubifs_prep_grp_node (c , dent2 , dlen2 , 0 );
11471150
0 commit comments