Home Home > GIT Browse > openSUSE-15.1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2019-08-15 09:57:52 +0300
committerNikolay Borisov <nborisov@suse.com>2019-08-15 09:58:00 +0300
commit2188182a0f0e616e39f37f2d67f855141b239a11 (patch)
tree00b7aa2e2dbbd00107f16620d051168c8c638470
parentad52e16d68e98efb0ba4ab11802bf8792703c365 (diff)
xfs: fix up agi unlinked list reservations (bsc#1145235).
-rw-r--r--patches.suse/xfs-fix-up-agi-unlinked-list-reservations.patch62
-rw-r--r--series.conf1
2 files changed, 63 insertions, 0 deletions
diff --git a/patches.suse/xfs-fix-up-agi-unlinked-list-reservations.patch b/patches.suse/xfs-fix-up-agi-unlinked-list-reservations.patch
new file mode 100644
index 0000000000..48e787add4
--- /dev/null
+++ b/patches.suse/xfs-fix-up-agi-unlinked-list-reservations.patch
@@ -0,0 +1,62 @@
+From: Brian Foster <bfoster@redhat.com>
+Date: Mon, 8 Jan 2018 10:41:36 -0800
+Subject: xfs: fix up agi unlinked list reservations
+Git-commit: e8341d9f6348640dff01d8c4a33695dc82bab5a3
+Patch-mainline: v4.16-rc1
+References: bsc#1145235
+
+The current AGI unlinked list addition and removal reservations do
+not reflect the worst case log usage. An unlinked list removal can
+log up to two on-disk inode clusters but only includes reservation
+for one. An unlinked list addition logs the on-disk cluster but
+includes reservation for an in-core inode.
+
+Update the AGI unlinked list reservation helpers to calculate the
+correct worst case reservation for the associated operations.
+
+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>
+Acked-by: Nikolay Borisov <nborisov@suse.com>
+---
+ fs/xfs/libxfs/xfs_trans_resv.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/fs/xfs/libxfs/xfs_trans_resv.c b/fs/xfs/libxfs/xfs_trans_resv.c
+index 838566b85622..173b1bc13ffe 100644
+--- a/fs/xfs/libxfs/xfs_trans_resv.c
++++ b/fs/xfs/libxfs/xfs_trans_resv.c
+@@ -282,13 +282,14 @@ xfs_calc_rename_reservation(
+ * For removing an inode from unlinked list at first, we can modify:
+ * the agi hash list and counters: sector size
+ * the on disk inode before ours in the agi hash list: inode cluster size
++ * the on disk inode in the agi hash list: inode cluster size
+ */
+ STATIC uint
+ xfs_calc_iunlink_remove_reservation(
+ struct xfs_mount *mp)
+ {
+ return xfs_calc_buf_res(1, mp->m_sb.sb_sectsize) +
+- max_t(uint, XFS_FSB_TO_B(mp, 1), mp->m_inode_cluster_size);
++ 2 * max_t(uint, XFS_FSB_TO_B(mp, 1), mp->m_inode_cluster_size);
+ }
+
+ /*
+@@ -320,13 +321,13 @@ xfs_calc_link_reservation(
+ /*
+ * For adding an inode to unlinked list we can modify:
+ * the agi hash list: sector size
+- * the unlinked inode: inode size
++ * the on disk inode: inode cluster size
+ */
+ STATIC uint
+ xfs_calc_iunlink_add_reservation(xfs_mount_t *mp)
+ {
+ return xfs_calc_buf_res(1, mp->m_sb.sb_sectsize) +
+- xfs_calc_inode_res(mp, 1);
++ max_t(uint, XFS_FSB_TO_B(mp, 1), mp->m_inode_cluster_size);
+ }
+
+ /*
+
diff --git a/series.conf b/series.conf
index 228171efd9..d3d28b05e1 100644
--- a/series.conf
+++ b/series.conf
@@ -11981,6 +11981,7 @@
patches.fixes/0006-jffs2-Fix-use-after-free-bug-in-jffs2_iget-s-error-h.patch
patches.suse/xfs-print-transaction-log-reservation-on-overrun.patch
patches.suse/xfs-include-inobt-buffers-in-ifree-tx-log-reservation.patch
+ patches.suse/xfs-fix-up-agi-unlinked-list-reservations.patch
patches.fixes/0004-iomap-report-collisions-between-directio-and-buffere.patch
patches.fixes/xfs-call-xfs_qm_dqattach-before-performing-reflink-o.patch
patches.fixes/xfs-preserve-i_rdev-when-recycling-a-reclaimable-inode.patch