projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9fa6121
)
ext4: Check if inode uses extents in ext4_inode_can_atomic_write()
author
Ritesh Harjani (IBM)
<ritesh.list@gmail.com>
Thu, 15 May 2025 19:50:50 +0000
(
01:20
+0530)
committer
Theodore Ts'o
<tytso@mit.edu>
Tue, 20 May 2025 14:31:12 +0000
(10:31 -0400)
EXT4 only supports doing atomic write on inodes which uses extents, so
add a check in ext4_inode_can_atomic_write() which gets called during
open.
Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Link:
https://patch.msgid.link/86bb502c979398a736ab371d8f35f6866a477f6c.1747337952.git.ritesh.list@gmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/ext4.h
patch
|
blob
|
blame
|
history
diff --git
a/fs/ext4/ext4.h
b/fs/ext4/ext4.h
index 923580be3cd6de45e6794a936df934d771c68905..bc2deb5bfe77a16b898c2c6f2cadcdc913d27e6a 100644
(file)
--- a/
fs/ext4/ext4.h
+++ b/
fs/ext4/ext4.h
@@
-3870,7
+3870,9
@@
static inline int ext4_buffer_uptodate(struct buffer_head *bh)
static inline bool ext4_inode_can_atomic_write(struct inode *inode)
{
- return S_ISREG(inode->i_mode) && EXT4_SB(inode->i_sb)->s_awu_min > 0;
+ return S_ISREG(inode->i_mode) &&
+ ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS) &&
+ EXT4_SB(inode->i_sb)->s_awu_min > 0;
}
extern int ext4_block_write_begin(handle_t *handle, struct folio *folio,