diff options
author | Wolfram Sang <wsa@kernel.org> | 2021-10-11 08:15:48 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2021-10-11 08:15:48 +0200 |
commit | c5c34f5793f384ed2895584c6e2350b059c3f161 (patch) | |
tree | 14a73568207fb3d38d7aa43439493ac8bc906bde /fs/ext4/fast_commit.c | |
parent | 669b2e4aa1a869def4dc207ea084fdd77366d646 (diff) | |
parent | 64570fbc14f8d7cb3fe3995f20e26bc25ce4b2cc (diff) |
Merge branch 'i2c/for-current' into i2c/for-mergewindow
Diffstat (limited to 'fs/ext4/fast_commit.c')
-rw-r--r-- | fs/ext4/fast_commit.c | 6 |
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); |