diff options
| author | Harshad Shirwadkar <harshadshirwadkar@gmail.com> | 2025-05-08 17:59:01 +0000 |
|---|---|---|
| committer | Theodore Ts'o <tytso@mit.edu> | 2025-05-08 21:56:17 -0400 |
| commit | 4d3266463ed06af2916b306bdb0ebd647726ba49 (patch) | |
| tree | eda31bfd7575e4447b1a2f09e193e75a6300f133 /fs/ext4/inline.c | |
| parent | 834224e81cdc265456f73fed748a349e43e2d8ef (diff) | |
ext4: for committing inode, make ext4_fc_track_inode wait
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. This ensures that by the
time ext4_reserve_inode_write() returns, it is ready to be modified
and won't be committed until the corresponding handle is open.
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@gmail.com>
Link: https://patch.msgid.link/20250508175908.1004880-3-harshadshirwadkar@gmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inline.c')
| -rw-r--r-- | fs/ext4/inline.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index 2c9b762925c7..fbc1c84b555c 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -601,6 +601,7 @@ retry: goto out; } + ext4_fc_track_inode(handle, inode); ret = ext4_destroy_inline_data_nolock(handle, inode); if (ret) goto out; |