]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
queue ue xfs-truncate-transaction-does-not-modify-the-inobt.patch for 4.9 and 4.14
authorSasha Levin <sashal@kernel.org>
Wed, 7 Nov 2018 18:11:27 +0000 (13:11 -0500)
committerSasha Levin <sashal@kernel.org>
Wed, 7 Nov 2018 18:11:27 +0000 (13:11 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.14/series
queue-4.14/xfs-truncate-transaction-does-not-modify-the-inobt.patch [new file with mode: 0644]
queue-4.9/series
queue-4.9/xfs-truncate-transaction-does-not-modify-the-inobt.patch [new file with mode: 0644]

index ab18cead581ec05b56bb9c8d399113d755feb229..e68aeae31eb8365b67bfa360654771a2f6e6d2d1 100644 (file)
@@ -7,3 +7,4 @@ revert-arm-tegra-fix-ulpi-regression-on-tegra20.patch
 clk-tegra-add-quirk-for-getting-cdev1-2-clocks-on-te.patch
 fsnotify-fix-ignore-mask-logic-in-fsnotify.patch
 gpio-mxs-get-rid-of-external-api-call.patch
+xfs-truncate-transaction-does-not-modify-the-inobt.patch
diff --git a/queue-4.14/xfs-truncate-transaction-does-not-modify-the-inobt.patch b/queue-4.14/xfs-truncate-transaction-does-not-modify-the-inobt.patch
new file mode 100644 (file)
index 0000000..bddb39e
--- /dev/null
@@ -0,0 +1,74 @@
+From b0d30d72974d885786141c6830ef1c73843430cd Mon Sep 17 00:00:00 2001
+From: Brian Foster <bfoster@redhat.com>
+Date: Sat, 3 Nov 2018 19:15:24 +0200
+Subject: xfs: truncate transaction does not modify the inobt
+
+[ Upstream commit a606ebdb859e78beb757dfefa08001df366e2ef5 ]
+
+The truncate transaction does not ever modify the inode btree, but
+includes an associated log reservation. Update
+xfs_calc_itruncate_reservation() to remove the reservation
+associated with inobt updates.
+
+[Amir: This commit was merged for kernel v4.16 and a twin commit was
+       merged for xfsprogs v4.16. As a result, a small xfs filesystem
+       formatted with features -m rmapbt=1,reflink=1 using mkfs.xfs
+       version >= v4.16 cannot be mounted with kernel < v4.16.
+
+       For example, xfstests generic/17{1,2,3} format a small fs and
+       when trying to mount it, they fail with an assert on this very
+       demonic line:
+
+ XFS (vdc): Log size 3075 blocks too small, minimum size is 3717 blocks
+ XFS (vdc): AAIEEE! Log failed size checks. Abort!
+ XFS: Assertion failed: 0, file: src/linux/fs/xfs/xfs_log.c, line: 666
+
+       The simple solution for stable kernels is to apply this patch,
+       because mkfs.xfs v4.16 is already in the wild, so we have to
+       assume that xfs filesystems with a "too small" log exist.
+       Regardless, xfsprogs maintainers should also consider reverting
+       the twin patch to stop creating those filesystems for the sake
+       of users with unpatched kernels.]
+
+Signed-off-by: Brian Foster <bfoster@redhat.com>
+Reviewed-by: Dave Chinner <dchinner@redhat.com>
+Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
+Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
+Cc: <stable@vger.kernel.org> # v4.9+
+Signed-off-by: Amir Goldstein <amir73il@gmail.com>
+Reviewed-by: Darrick J . Wong <darrick.wong@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/xfs/libxfs/xfs_trans_resv.c | 9 +--------
+ 1 file changed, 1 insertion(+), 8 deletions(-)
+
+diff --git a/fs/xfs/libxfs/xfs_trans_resv.c b/fs/xfs/libxfs/xfs_trans_resv.c
+index 6bd916bd35e2..48eff18c5496 100644
+--- a/fs/xfs/libxfs/xfs_trans_resv.c
++++ b/fs/xfs/libxfs/xfs_trans_resv.c
+@@ -232,8 +232,6 @@ xfs_calc_write_reservation(
+  *    the super block to reflect the freed blocks: sector size
+  *    worst case split in allocation btrees per extent assuming 4 extents:
+  *            4 exts * 2 trees * (2 * max depth - 1) * block size
+- *    the inode btree: max depth * blocksize
+- *    the allocation btrees: 2 trees * (max depth - 1) * block size
+  */
+ STATIC uint
+ xfs_calc_itruncate_reservation(
+@@ -245,12 +243,7 @@ xfs_calc_itruncate_reservation(
+                                     XFS_FSB_TO_B(mp, 1))),
+                   (xfs_calc_buf_res(9, mp->m_sb.sb_sectsize) +
+                    xfs_calc_buf_res(xfs_allocfree_log_count(mp, 4),
+-                                    XFS_FSB_TO_B(mp, 1)) +
+-                  xfs_calc_buf_res(5, 0) +
+-                  xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1),
+-                                   XFS_FSB_TO_B(mp, 1)) +
+-                  xfs_calc_buf_res(2 + mp->m_ialloc_blks +
+-                                   mp->m_in_maxlevels, 0)));
++                                    XFS_FSB_TO_B(mp, 1))));
+ }
+ /*
+-- 
+2.17.1
+
index 3241ecdc4d6005c4dd65609e04194d5a3cfc2bea..cda481602fd0e8906527fc21e2cadd6bcc7a6344 100644 (file)
@@ -154,3 +154,4 @@ revert-x86-mm-expand-static-page-table-for-fixmap-sp.patch
 crypto-shash-fix-a-sleep-in-atomic-bug-in-shash_setk.patch
 ahci-don-t-ignore-result-code-of-ahci_reset_controll.patch
 gpio-mxs-get-rid-of-external-api-call.patch
+xfs-truncate-transaction-does-not-modify-the-inobt.patch
diff --git a/queue-4.9/xfs-truncate-transaction-does-not-modify-the-inobt.patch b/queue-4.9/xfs-truncate-transaction-does-not-modify-the-inobt.patch
new file mode 100644 (file)
index 0000000..f1b0cd4
--- /dev/null
@@ -0,0 +1,74 @@
+From aa247ef6fa86a4793a0eb13bd29139fdfe684075 Mon Sep 17 00:00:00 2001
+From: Brian Foster <bfoster@redhat.com>
+Date: Sat, 3 Nov 2018 19:15:24 +0200
+Subject: xfs: truncate transaction does not modify the inobt
+
+[ Upstream commit a606ebdb859e78beb757dfefa08001df366e2ef5 ]
+
+The truncate transaction does not ever modify the inode btree, but
+includes an associated log reservation. Update
+xfs_calc_itruncate_reservation() to remove the reservation
+associated with inobt updates.
+
+[Amir: This commit was merged for kernel v4.16 and a twin commit was
+       merged for xfsprogs v4.16. As a result, a small xfs filesystem
+       formatted with features -m rmapbt=1,reflink=1 using mkfs.xfs
+       version >= v4.16 cannot be mounted with kernel < v4.16.
+
+       For example, xfstests generic/17{1,2,3} format a small fs and
+       when trying to mount it, they fail with an assert on this very
+       demonic line:
+
+ XFS (vdc): Log size 3075 blocks too small, minimum size is 3717 blocks
+ XFS (vdc): AAIEEE! Log failed size checks. Abort!
+ XFS: Assertion failed: 0, file: src/linux/fs/xfs/xfs_log.c, line: 666
+
+       The simple solution for stable kernels is to apply this patch,
+       because mkfs.xfs v4.16 is already in the wild, so we have to
+       assume that xfs filesystems with a "too small" log exist.
+       Regardless, xfsprogs maintainers should also consider reverting
+       the twin patch to stop creating those filesystems for the sake
+       of users with unpatched kernels.]
+
+Signed-off-by: Brian Foster <bfoster@redhat.com>
+Reviewed-by: Dave Chinner <dchinner@redhat.com>
+Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
+Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
+Cc: <stable@vger.kernel.org> # v4.9+
+Signed-off-by: Amir Goldstein <amir73il@gmail.com>
+Reviewed-by: Darrick J . Wong <darrick.wong@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/xfs/libxfs/xfs_trans_resv.c | 9 +--------
+ 1 file changed, 1 insertion(+), 8 deletions(-)
+
+diff --git a/fs/xfs/libxfs/xfs_trans_resv.c b/fs/xfs/libxfs/xfs_trans_resv.c
+index b456cca1bfb2..c0ecdec8e0a9 100644
+--- a/fs/xfs/libxfs/xfs_trans_resv.c
++++ b/fs/xfs/libxfs/xfs_trans_resv.c
+@@ -232,8 +232,6 @@ xfs_calc_write_reservation(
+  *    the super block to reflect the freed blocks: sector size
+  *    worst case split in allocation btrees per extent assuming 4 extents:
+  *            4 exts * 2 trees * (2 * max depth - 1) * block size
+- *    the inode btree: max depth * blocksize
+- *    the allocation btrees: 2 trees * (max depth - 1) * block size
+  */
+ STATIC uint
+ xfs_calc_itruncate_reservation(
+@@ -245,12 +243,7 @@ xfs_calc_itruncate_reservation(
+                                     XFS_FSB_TO_B(mp, 1))),
+                   (xfs_calc_buf_res(9, mp->m_sb.sb_sectsize) +
+                    xfs_calc_buf_res(xfs_allocfree_log_count(mp, 4),
+-                                    XFS_FSB_TO_B(mp, 1)) +
+-                  xfs_calc_buf_res(5, 0) +
+-                  xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1),
+-                                   XFS_FSB_TO_B(mp, 1)) +
+-                  xfs_calc_buf_res(2 + mp->m_ialloc_blks +
+-                                   mp->m_in_maxlevels, 0)));
++                                    XFS_FSB_TO_B(mp, 1))));
+ }
+ /*
+-- 
+2.17.1
+