On Wed 29-05-24 01:19:55, Harshad Shirwadkar wrote: > If the inode that's being requested to track using ext4_fc_track_inode > is being committed, then wait until the inode finishes the > commit. Also, add calls to ext4_fc_track_inode at the right places. > > With this patch, now calling ext4_reserve_inode_write() results in > inode being tracked for next fast commit. A subtle lock ordering > requirement with i_data_sem (which is documented in the code) requires > that ext4_fc_track_inode() be called before grabbing i_data_sem. So, > this patch also adds explicit ext4_fc_track_inode() calls in places > where i_data_sem grabbed. > > Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@xxxxxxxxx> One more thing I've noticed: > @@ -5727,6 +5730,7 @@ ext4_reserve_inode_write(handle_t *handle, struct inode *inode, > brelse(iloc->bh); > iloc->bh = NULL; > } > + ext4_fc_track_inode(handle, inode); > } > ext4_std_error(inode->i_sb, err); > return err; Calling ext4_fc_track_inode() when ext4_get_write_access() failed is pointless (inode isn't going to be written) and confusing. We should do that only in the success case. Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR