Skip to content

Commit

Permalink
Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/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
  • Loading branch information
Linus Torvalds committed May 25, 2019
2 parents b2ad813 + 66883da commit 35efb51
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion fs/ext4/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ static int ext4_d_compare(const struct dentry *dentry, unsigned int len,
if (!IS_CASEFOLDED(dentry->d_parent->d_inode)) {
if (len != name->len)
return -1;
return !memcmp(str, name, len);
return memcmp(str, name->name, len);
}

return ext4_ci_compare(dentry->d_parent->d_inode, name, &qstr);
Expand Down
12 changes: 8 additions & 4 deletions fs/ext4/extents.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,10 +518,14 @@ __read_extent_tree_block(const char *function, unsigned int line,
}
if (buffer_verified(bh) && !(flags & EXT4_EX_FORCE_CACHE))
return bh;
err = __ext4_ext_check(function, line, inode,
ext_block_hdr(bh), depth, pblk);
if (err)
goto errout;
if (!ext4_has_feature_journal(inode->i_sb) ||
(inode->i_ino !=
le32_to_cpu(EXT4_SB(inode->i_sb)->s_es->s_journal_inum))) {
err = __ext4_ext_check(function, line, inode,
ext_block_hdr(bh), depth, pblk);
if (err)
goto errout;
}
set_buffer_verified(bh);
/*
* If this is a leaf block, cache all of its entries
Expand Down
23 changes: 10 additions & 13 deletions fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -5625,25 +5625,22 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
up_write(&EXT4_I(inode)->i_data_sem);
ext4_journal_stop(handle);
if (error) {
if (orphan)
if (orphan && inode->i_nlink)
ext4_orphan_del(NULL, inode);
goto err_out;
}
}
if (!shrink)
if (!shrink) {
pagecache_isize_extended(inode, oldsize, inode->i_size);

/*
* Blocks are going to be removed from the inode. Wait
* for dio in flight. Temporarily disable
* dioread_nolock to prevent livelock.
*/
if (orphan) {
if (!ext4_should_journal_data(inode)) {
inode_dio_wait(inode);
} else
ext4_wait_for_tail_page_commit(inode);
} else {
/*
* Blocks are going to be removed from the inode. Wait
* for dio in flight.
*/
inode_dio_wait(inode);
}
if (orphan && ext4_should_journal_data(inode))
ext4_wait_for_tail_page_commit(inode);
down_write(&EXT4_I(inode)->i_mmap_sem);

rc = ext4_break_layouts(inode);
Expand Down

0 comments on commit 35efb51

Please sign in to comment.