From: Greg Kroah-Hartman Date: Mon, 8 Oct 2012 19:46:19 +0000 (-0700) Subject: 3.0-stable patches X-Git-Tag: v3.0.46~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8e6fb27b545bbbd978d98d892ea8db0e43252129;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0-stable patches added patches: ext4-always-set-i_op-in-ext4_mknod.patch ext4-fix-fdatasync-for-files-with-only-i_size-changes.patch ext4-online-defrag-is-not-supported-for-journaled-files.patch --- diff --git a/queue-3.0/ext4-always-set-i_op-in-ext4_mknod.patch b/queue-3.0/ext4-always-set-i_op-in-ext4_mknod.patch new file mode 100644 index 00000000000..0468fb49e03 --- /dev/null +++ b/queue-3.0/ext4-always-set-i_op-in-ext4_mknod.patch @@ -0,0 +1,33 @@ +From 6a08f447facb4f9e29fcc30fb68060bb5a0d21c2 Mon Sep 17 00:00:00 2001 +From: Bernd Schubert +Date: Wed, 26 Sep 2012 21:24:57 -0400 +Subject: ext4: always set i_op in ext4_mknod() + +From: Bernd Schubert + +commit 6a08f447facb4f9e29fcc30fb68060bb5a0d21c2 upstream. + +ext4_special_inode_operations have their own ifdef CONFIG_EXT4_FS_XATTR +to mask those methods. And ext4_iget also always sets it, so there is +an inconsistency. + +Signed-off-by: Bernd Schubert +Signed-off-by: "Theodore Ts'o" +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ext4/namei.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/fs/ext4/namei.c ++++ b/fs/ext4/namei.c +@@ -1799,9 +1799,7 @@ retry: + err = PTR_ERR(inode); + if (!IS_ERR(inode)) { + init_special_inode(inode, inode->i_mode, rdev); +-#ifdef CONFIG_EXT4_FS_XATTR + inode->i_op = &ext4_special_inode_operations; +-#endif + err = ext4_add_nondir(handle, dentry, inode); + } + ext4_journal_stop(handle); diff --git a/queue-3.0/ext4-fix-fdatasync-for-files-with-only-i_size-changes.patch b/queue-3.0/ext4-fix-fdatasync-for-files-with-only-i_size-changes.patch new file mode 100644 index 00000000000..7e36d92c245 --- /dev/null +++ b/queue-3.0/ext4-fix-fdatasync-for-files-with-only-i_size-changes.patch @@ -0,0 +1,56 @@ +From b71fc079b5d8f42b2a52743c8d2f1d35d655b1c5 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Wed, 26 Sep 2012 21:52:20 -0400 +Subject: ext4: fix fdatasync() for files with only i_size changes + +From: Jan Kara + +commit b71fc079b5d8f42b2a52743c8d2f1d35d655b1c5 upstream. + +Code tracking when transaction needs to be committed on fdatasync(2) forgets +to handle a situation when only inode's i_size is changed. Thus in such +situations fdatasync(2) doesn't force transaction with new i_size to disk +and that can result in wrong i_size after a crash. + +Fix the issue by updating inode's i_datasync_tid whenever its size is +updated. + +Reported-by: Kristian Nielsen +Signed-off-by: Jan Kara +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ext4/inode.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/fs/ext4/inode.c ++++ b/fs/ext4/inode.c +@@ -5151,6 +5151,7 @@ static int ext4_do_update_inode(handle_t + struct ext4_inode_info *ei = EXT4_I(inode); + struct buffer_head *bh = iloc->bh; + int err = 0, rc, block; ++ int need_datasync = 0; + + /* For fields not not tracking in the in-memory inode, + * initialise them to zero for new inodes. */ +@@ -5199,7 +5200,10 @@ static int ext4_do_update_inode(handle_t + raw_inode->i_file_acl_high = + cpu_to_le16(ei->i_file_acl >> 32); + raw_inode->i_file_acl_lo = cpu_to_le32(ei->i_file_acl); +- ext4_isize_set(raw_inode, ei->i_disksize); ++ if (ei->i_disksize != ext4_isize(raw_inode)) { ++ ext4_isize_set(raw_inode, ei->i_disksize); ++ need_datasync = 1; ++ } + if (ei->i_disksize > 0x7fffffffULL) { + struct super_block *sb = inode->i_sb; + if (!EXT4_HAS_RO_COMPAT_FEATURE(sb, +@@ -5252,7 +5256,7 @@ static int ext4_do_update_inode(handle_t + err = rc; + ext4_clear_inode_state(inode, EXT4_STATE_NEW); + +- ext4_update_inode_fsync_trans(handle, inode, 0); ++ ext4_update_inode_fsync_trans(handle, inode, need_datasync); + out_brelse: + brelse(bh); + ext4_std_error(inode->i_sb, err); diff --git a/queue-3.0/ext4-online-defrag-is-not-supported-for-journaled-files.patch b/queue-3.0/ext4-online-defrag-is-not-supported-for-journaled-files.patch new file mode 100644 index 00000000000..2aad8527e62 --- /dev/null +++ b/queue-3.0/ext4-online-defrag-is-not-supported-for-journaled-files.patch @@ -0,0 +1,37 @@ +From f066055a3449f0e5b0ae4f3ceab4445bead47638 Mon Sep 17 00:00:00 2001 +From: Dmitry Monakhov +Date: Wed, 26 Sep 2012 12:32:54 -0400 +Subject: ext4: online defrag is not supported for journaled files + +From: Dmitry Monakhov + +commit f066055a3449f0e5b0ae4f3ceab4445bead47638 upstream. + +Proper block swap for inodes with full journaling enabled is +truly non obvious task. In order to be on a safe side let's +explicitly disable it for now. + +Signed-off-by: Dmitry Monakhov +Signed-off-by: "Theodore Ts'o" +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ext4/move_extent.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/fs/ext4/move_extent.c ++++ b/fs/ext4/move_extent.c +@@ -1209,7 +1209,12 @@ ext4_move_extents(struct file *o_filp, s + orig_inode->i_ino, donor_inode->i_ino); + return -EINVAL; + } +- ++ /* TODO: This is non obvious task to swap blocks for inodes with full ++ jornaling enabled */ ++ if (ext4_should_journal_data(orig_inode) || ++ ext4_should_journal_data(donor_inode)) { ++ return -EINVAL; ++ } + /* Protect orig and donor inodes against a truncate */ + ret1 = mext_inode_double_lock(orig_inode, donor_inode); + if (ret1 < 0) diff --git a/queue-3.0/series b/queue-3.0/series index bc10a6214ba..69469e0ce49 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -44,3 +44,6 @@ scsi-zfcp-remove-invalid-reference-to-list-iterator-variable.patch scsi-zfcp-restore-refcount-check-on-port_remove.patch scsi-zfcp-only-access-zfcp_scsi_dev-for-valid-scsi_device.patch pci-check-p2p-bridge-for-invalid-secondary-subordinate-range.patch +ext4-online-defrag-is-not-supported-for-journaled-files.patch +ext4-always-set-i_op-in-ext4_mknod.patch +ext4-fix-fdatasync-for-files-with-only-i_size-changes.patch