ext4: allow inode expansion for nojournal file systems
Runs of xfstest ext4/022 on nojournal file systems result in failures because the inodes of some of its test files do not expand as expected. The cause is a conditional in ext4_mark_inode_dirty() that prevents inode expansion unless the test file system has a journal. Remove this unnecessary restriction. Signed-off-by: Eric Whitney <enwlinux@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
committed by
Theodore Ts'o
parent
eeca7ea1ba
commit
88e0387769
+7
-5
@@ -5474,18 +5474,20 @@ int ext4_mark_inode_dirty(handle_t *handle, struct inode *inode)
|
|||||||
err = ext4_reserve_inode_write(handle, inode, &iloc);
|
err = ext4_reserve_inode_write(handle, inode, &iloc);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
if (ext4_handle_valid(handle) &&
|
if (EXT4_I(inode)->i_extra_isize < sbi->s_want_extra_isize &&
|
||||||
EXT4_I(inode)->i_extra_isize < sbi->s_want_extra_isize &&
|
|
||||||
!ext4_test_inode_state(inode, EXT4_STATE_NO_EXPAND)) {
|
!ext4_test_inode_state(inode, EXT4_STATE_NO_EXPAND)) {
|
||||||
/*
|
/*
|
||||||
* We need extra buffer credits since we may write into EA block
|
* In nojournal mode, we can immediately attempt to expand
|
||||||
|
* the inode. When journaled, we first need to obtain extra
|
||||||
|
* buffer credits since we may write into the EA block
|
||||||
* with this same handle. If journal_extend fails, then it will
|
* with this same handle. If journal_extend fails, then it will
|
||||||
* only result in a minor loss of functionality for that inode.
|
* only result in a minor loss of functionality for that inode.
|
||||||
* If this is felt to be critical, then e2fsck should be run to
|
* If this is felt to be critical, then e2fsck should be run to
|
||||||
* force a large enough s_min_extra_isize.
|
* force a large enough s_min_extra_isize.
|
||||||
*/
|
*/
|
||||||
if ((jbd2_journal_extend(handle,
|
if (!ext4_handle_valid(handle) ||
|
||||||
EXT4_DATA_TRANS_BLOCKS(inode->i_sb))) == 0) {
|
jbd2_journal_extend(handle,
|
||||||
|
EXT4_DATA_TRANS_BLOCKS(inode->i_sb)) == 0) {
|
||||||
ret = ext4_expand_extra_isize(inode,
|
ret = ext4_expand_extra_isize(inode,
|
||||||
sbi->s_want_extra_isize,
|
sbi->s_want_extra_isize,
|
||||||
iloc, handle);
|
iloc, handle);
|
||||||
|
|||||||
Reference in New Issue
Block a user