Skip to content

Commit 35efb51

Browse files
committed
Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Pull ext4 fixes from Ted Ts'o: "Bug fixes (including a regression fix) for ext4" * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: ext4: fix dcache lookup of !casefolded directories ext4: do not delete unlinked inode from orphan list on failed truncate ext4: wait for outstanding dio during truncate in nojournal mode ext4: don't perform block validity checks on the journal inode
2 parents b2ad813 + 66883da commit 35efb51

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

fs/ext4/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ static int ext4_d_compare(const struct dentry *dentry, unsigned int len,
671671
if (!IS_CASEFOLDED(dentry->d_parent->d_inode)) {
672672
if (len != name->len)
673673
return -1;
674-
return !memcmp(str, name, len);
674+
return memcmp(str, name->name, len);
675675
}
676676

677677
return ext4_ci_compare(dentry->d_parent->d_inode, name, &qstr);

fs/ext4/extents.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -518,10 +518,14 @@ __read_extent_tree_block(const char *function, unsigned int line,
518518
}
519519
if (buffer_verified(bh) && !(flags & EXT4_EX_FORCE_CACHE))
520520
return bh;
521-
err = __ext4_ext_check(function, line, inode,
522-
ext_block_hdr(bh), depth, pblk);
523-
if (err)
524-
goto errout;
521+
if (!ext4_has_feature_journal(inode->i_sb) ||
522+
(inode->i_ino !=
523+
le32_to_cpu(EXT4_SB(inode->i_sb)->s_es->s_journal_inum))) {
524+
err = __ext4_ext_check(function, line, inode,
525+
ext_block_hdr(bh), depth, pblk);
526+
if (err)
527+
goto errout;
528+
}
525529
set_buffer_verified(bh);
526530
/*
527531
* If this is a leaf block, cache all of its entries

fs/ext4/inode.c

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5625,25 +5625,22 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
56255625
up_write(&EXT4_I(inode)->i_data_sem);
56265626
ext4_journal_stop(handle);
56275627
if (error) {
5628-
if (orphan)
5628+
if (orphan && inode->i_nlink)
56295629
ext4_orphan_del(NULL, inode);
56305630
goto err_out;
56315631
}
56325632
}
5633-
if (!shrink)
5633+
if (!shrink) {
56345634
pagecache_isize_extended(inode, oldsize, inode->i_size);
5635-
5636-
/*
5637-
* Blocks are going to be removed from the inode. Wait
5638-
* for dio in flight. Temporarily disable
5639-
* dioread_nolock to prevent livelock.
5640-
*/
5641-
if (orphan) {
5642-
if (!ext4_should_journal_data(inode)) {
5643-
inode_dio_wait(inode);
5644-
} else
5645-
ext4_wait_for_tail_page_commit(inode);
5635+
} else {
5636+
/*
5637+
* Blocks are going to be removed from the inode. Wait
5638+
* for dio in flight.
5639+
*/
5640+
inode_dio_wait(inode);
56465641
}
5642+
if (orphan && ext4_should_journal_data(inode))
5643+
ext4_wait_for_tail_page_commit(inode);
56475644
down_write(&EXT4_I(inode)->i_mmap_sem);
56485645

56495646
rc = ext4_break_layouts(inode);

0 commit comments

Comments
 (0)