diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-08 03:43:32 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-08 03:43:32 +0000 |
commit | f530fbb7a18f2794e4178dfb7cd07719b9586147 (patch) | |
tree | 3f704b17427743e26452771cf7da2ed110346ddd /fs/ext4 | |
parent | Adding debian version 4.19.260-1. (diff) | |
download | linux-f530fbb7a18f2794e4178dfb7cd07719b9586147.tar.xz linux-f530fbb7a18f2794e4178dfb7cd07719b9586147.zip |
Merging upstream version 4.19.269.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/file.c | 6 | ||||
-rw-r--r-- | fs/ext4/inode.c | 7 | ||||
-rw-r--r-- | fs/ext4/migrate.c | 3 | ||||
-rw-r--r-- | fs/ext4/resize.c | 2 | ||||
-rw-r--r-- | fs/ext4/super.c | 3 |
5 files changed, 18 insertions, 3 deletions
diff --git a/fs/ext4/file.c b/fs/ext4/file.c index 52d155b4e..d8b7e97dd 100644 --- a/fs/ext4/file.c +++ b/fs/ext4/file.c @@ -501,6 +501,12 @@ loff_t ext4_llseek(struct file *file, loff_t offset, int whence) inode_unlock_shared(inode); break; } + /* + * Make sure inline data cannot be created anymore since we are going + * to allocate blocks for DIO. We know the inode does not have any + * inline data now because ext4_dio_supported() checked for that. + */ + ext4_clear_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA); if (offset < 0) return offset; diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 34cee87a0..95139c992 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -1310,6 +1310,13 @@ retry_grab: page = grab_cache_page_write_begin(mapping, index, flags); if (!page) return -ENOMEM; + /* + * The same as page allocation, we prealloc buffer heads before + * starting the handle. + */ + if (!page_has_buffers(page)) + create_empty_buffers(page, inode->i_sb->s_blocksize, 0); + unlock_page(page); retry_journal: diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c index 37ce665ae..4a72583c7 100644 --- a/fs/ext4/migrate.c +++ b/fs/ext4/migrate.c @@ -443,7 +443,8 @@ int ext4_ext_migrate(struct inode *inode) * already is extent-based, error out. */ if (!ext4_has_feature_extents(inode->i_sb) || - (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) + ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS) || + ext4_has_inline_data(inode)) return -EINVAL; if (S_ISLNK(inode->i_mode) && inode->i_blocks == 0) diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index dd23c97ae..8737d1bcd 100644 --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c @@ -2092,7 +2092,7 @@ retry: goto out; } - if (ext4_blocks_count(es) == n_blocks_count) + if (ext4_blocks_count(es) == n_blocks_count && n_blocks_count_retry == 0) goto out; err = ext4_alloc_flex_bg_array(sb, n_group + 1); diff --git a/fs/ext4/super.c b/fs/ext4/super.c index bf120842a..f00cc301d 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3112,6 +3112,7 @@ static int ext4_lazyinit_thread(void *arg) unsigned long next_wakeup, cur; BUG_ON(NULL == eli); + set_freezable(); cont_thread: while (true) { @@ -5721,7 +5722,7 @@ static int ext4_write_info(struct super_block *sb, int type) handle_t *handle; /* Data block + inode block */ - handle = ext4_journal_start(d_inode(sb->s_root), EXT4_HT_QUOTA, 2); + handle = ext4_journal_start_sb(sb, EXT4_HT_QUOTA, 2); if (IS_ERR(handle)) return PTR_ERR(handle); ret = dquot_commit_info(sb, type); |