Commit 35efb51e authored by Linus Torvalds's avatar Linus Torvalds

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
parents b2ad8136 66883da1
...@@ -671,7 +671,7 @@ static int ext4_d_compare(const struct dentry *dentry, unsigned int len, ...@@ -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 (!IS_CASEFOLDED(dentry->d_parent->d_inode)) {
if (len != name->len) if (len != name->len)
return -1; return -1;
return !memcmp(str, name, len); return memcmp(str, name->name, len);
} }
return ext4_ci_compare(dentry->d_parent->d_inode, name, &qstr); return ext4_ci_compare(dentry->d_parent->d_inode, name, &qstr);
......
...@@ -518,10 +518,14 @@ __read_extent_tree_block(const char *function, unsigned int line, ...@@ -518,10 +518,14 @@ __read_extent_tree_block(const char *function, unsigned int line,
} }
if (buffer_verified(bh) && !(flags & EXT4_EX_FORCE_CACHE)) if (buffer_verified(bh) && !(flags & EXT4_EX_FORCE_CACHE))
return bh; return bh;
err = __ext4_ext_check(function, line, inode, if (!ext4_has_feature_journal(inode->i_sb) ||
ext_block_hdr(bh), depth, pblk); (inode->i_ino !=
if (err) le32_to_cpu(EXT4_SB(inode->i_sb)->s_es->s_journal_inum))) {
goto errout; err = __ext4_ext_check(function, line, inode,
ext_block_hdr(bh), depth, pblk);
if (err)
goto errout;
}
set_buffer_verified(bh); set_buffer_verified(bh);
/* /*
* If this is a leaf block, cache all of its entries * If this is a leaf block, cache all of its entries
......
...@@ -5625,25 +5625,22 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr) ...@@ -5625,25 +5625,22 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
up_write(&EXT4_I(inode)->i_data_sem); up_write(&EXT4_I(inode)->i_data_sem);
ext4_journal_stop(handle); ext4_journal_stop(handle);
if (error) { if (error) {
if (orphan) if (orphan && inode->i_nlink)
ext4_orphan_del(NULL, inode); ext4_orphan_del(NULL, inode);
goto err_out; goto err_out;
} }
} }
if (!shrink) if (!shrink) {
pagecache_isize_extended(inode, oldsize, inode->i_size); pagecache_isize_extended(inode, oldsize, inode->i_size);
} else {
/* /*
* Blocks are going to be removed from the inode. Wait * Blocks are going to be removed from the inode. Wait
* for dio in flight. Temporarily disable * for dio in flight.
* dioread_nolock to prevent livelock. */
*/ inode_dio_wait(inode);
if (orphan) {
if (!ext4_should_journal_data(inode)) {
inode_dio_wait(inode);
} else
ext4_wait_for_tail_page_commit(inode);
} }
if (orphan && ext4_should_journal_data(inode))
ext4_wait_for_tail_page_commit(inode);
down_write(&EXT4_I(inode)->i_mmap_sem); down_write(&EXT4_I(inode)->i_mmap_sem);
rc = ext4_break_layouts(inode); rc = ext4_break_layouts(inode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment