aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-12-17 15:14:33 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-12-17 15:14:33 -0500
commit1c6b942d7d39765a81ea0577c893edaddfccad3d (patch)
treebab0b0032f963b838e4d0ccf5c078617ceafed2f
parentf3b5ad89de16f5d42e8ad36fbdf85f705c1ae051 (diff)
parent9d5afec6b8bd46d6ed821aa1579634437f58ef1f (diff)
Merge tag 'ext4_for_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Pull ext4 fixes from Ted Ts'o: "Fix a regression which caused us to fail to interpret symlinks in very ancient ext3 file system images. Also fix two xfstests failures, one of which could cause an OOPS, plus an additional bug fix caught by fuzz testing" * tag 'ext4_for_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: ext4: fix crash when a directory's i_size is too small ext4: add missing error check in __ext4_new_inode() ext4: fix fdatasync(2) after fallocate(2) operation ext4: support fast symlinks from ext3 file systems
-rw-r--r--fs/ext4/extents.c1
-rw-r--r--fs/ext4/ialloc.c2
-rw-r--r--fs/ext4/inode.c9
-rw-r--r--fs/ext4/namei.c4
4 files changed, 16 insertions, 0 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 07bca11749d4..c941251ac0c0 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4722,6 +4722,7 @@ retry:
4722 EXT4_INODE_EOFBLOCKS); 4722 EXT4_INODE_EOFBLOCKS);
4723 } 4723 }
4724 ext4_mark_inode_dirty(handle, inode); 4724 ext4_mark_inode_dirty(handle, inode);
4725 ext4_update_inode_fsync_trans(handle, inode, 1);
4725 ret2 = ext4_journal_stop(handle); 4726 ret2 = ext4_journal_stop(handle);
4726 if (ret2) 4727 if (ret2)
4727 break; 4728 break;
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index b4267d72f249..b32cf263750d 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -816,6 +816,8 @@ struct inode *__ext4_new_inode(handle_t *handle, struct inode *dir,
816#ifdef CONFIG_EXT4_FS_POSIX_ACL 816#ifdef CONFIG_EXT4_FS_POSIX_ACL
817 struct posix_acl *p = get_acl(dir, ACL_TYPE_DEFAULT); 817 struct posix_acl *p = get_acl(dir, ACL_TYPE_DEFAULT);
818 818
819 if (IS_ERR(p))
820 return ERR_CAST(p);
819 if (p) { 821 if (p) {
820 int acl_size = p->a_count * sizeof(ext4_acl_entry); 822 int acl_size = p->a_count * sizeof(ext4_acl_entry);
821 823
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 7df2c5644e59..534a9130f625 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -149,6 +149,15 @@ static int ext4_meta_trans_blocks(struct inode *inode, int lblocks,
149 */ 149 */
150int ext4_inode_is_fast_symlink(struct inode *inode) 150int ext4_inode_is_fast_symlink(struct inode *inode)
151{ 151{
152 if (!(EXT4_I(inode)->i_flags & EXT4_EA_INODE_FL)) {
153 int ea_blocks = EXT4_I(inode)->i_file_acl ?
154 EXT4_CLUSTER_SIZE(inode->i_sb) >> 9 : 0;
155
156 if (ext4_has_inline_data(inode))
157 return 0;
158
159 return (S_ISLNK(inode->i_mode) && inode->i_blocks - ea_blocks == 0);
160 }
152 return S_ISLNK(inode->i_mode) && inode->i_size && 161 return S_ISLNK(inode->i_mode) && inode->i_size &&
153 (inode->i_size < EXT4_N_BLOCKS * 4); 162 (inode->i_size < EXT4_N_BLOCKS * 4);
154} 163}
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 798b3ac680db..e750d68fbcb5 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1399,6 +1399,10 @@ static struct buffer_head * ext4_find_entry (struct inode *dir,
1399 "falling back\n")); 1399 "falling back\n"));
1400 } 1400 }
1401 nblocks = dir->i_size >> EXT4_BLOCK_SIZE_BITS(sb); 1401 nblocks = dir->i_size >> EXT4_BLOCK_SIZE_BITS(sb);
1402 if (!nblocks) {
1403 ret = NULL;
1404 goto cleanup_and_exit;
1405 }
1402 start = EXT4_I(dir)->i_dir_start_lookup; 1406 start = EXT4_I(dir)->i_dir_start_lookup;
1403 if (start >= nblocks) 1407 if (start >= nblocks)
1404 start = 0; 1408 start = 0;