aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/fast_commit.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-10-04 09:16:43 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-10-04 09:16:43 +0200
commit8bf7a12c628d1cad59cd8057171dd3ef95f0857a (patch)
tree31bd590f6dfb61e351be19bfcbc636e8b30ecce3 /fs/ext4/fast_commit.c
parentMerge 5.15-rc3 into char-misc next (diff)
parentLinux 5.15-rc4 (diff)
downloadlinux-8bf7a12c628d1cad59cd8057171dd3ef95f0857a.tar.gz
linux-8bf7a12c628d1cad59cd8057171dd3ef95f0857a.zip
Merge 5.15-rc4 into char-misc-next
We need the char-misc fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/ext4/fast_commit.c')
-rw-r--r--fs/ext4/fast_commit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
index 8e610a381862..8ea5a81e6554 100644
--- a/fs/ext4/fast_commit.c
+++ b/fs/ext4/fast_commit.c
@@ -892,6 +892,12 @@ static int ext4_fc_write_inode_data(struct inode *inode, u32 *crc)
sizeof(lrange), (u8 *)&lrange, crc))
return -ENOSPC;
} else {
+ unsigned int max = (map.m_flags & EXT4_MAP_UNWRITTEN) ?
+ EXT_UNWRITTEN_MAX_LEN : EXT_INIT_MAX_LEN;
+
+ /* Limit the number of blocks in one extent */
+ map.m_len = min(max, map.m_len);
+
fc_ext.fc_ino = cpu_to_le32(inode->i_ino);
ex = (struct ext4_extent *)&fc_ext.fc_ex;
ex->ee_block = cpu_to_le32(map.m_lblk);