Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Iliopoulos <ailiopoulos@suse.com>2019-03-20 02:02:59 +0100
committerAnthony Iliopoulos <ailiopoulos@suse.com>2019-03-20 02:02:59 +0100
commit227ca72ac635d5c91d5bce43a07206c880a0b6b3 (patch)
tree92d90bbd1da3f7df395662fa599555dab647d4b8
parent76eca08c721340f5650a63303ea59ff900307f68 (diff)
- xfs: fix contiguous dquot chunk iteration livelock
(bsc#1070995). - Refresh patches.fixes/0059-xfs-introduce-the-xfs_iext_cursor-abstraction.patch.
-rw-r--r--patches.fixes/0059-xfs-introduce-the-xfs_iext_cursor-abstraction.patch10
-rw-r--r--patches.fixes/xfs-fix-contiguous-dquot-chunk-iteration-livelock.patch59
-rw-r--r--series.conf1
3 files changed, 65 insertions, 5 deletions
diff --git a/patches.fixes/0059-xfs-introduce-the-xfs_iext_cursor-abstraction.patch b/patches.fixes/0059-xfs-introduce-the-xfs_iext_cursor-abstraction.patch
index 48355534ae..12cb1393fa 100644
--- a/patches.fixes/0059-xfs-introduce-the-xfs_iext_cursor-abstraction.patch
+++ b/patches.fixes/0059-xfs-introduce-the-xfs_iext_cursor-abstraction.patch
@@ -1873,11 +1873,11 @@ Acked-by: Nikolay Borisov <nborisov@suse.com>
return error;
}
-- if (xfs_iext_lookup_extent(quotip, &quotip->i_df, start, &idx, &got))
-+ if (xfs_iext_lookup_extent(quotip, &quotip->i_df, start, &cur, &got))
- *id = got.br_startoff * mp->m_quotainfo->qi_dqperchunk;
- else
- error = -ENOENT;
+- if (xfs_iext_lookup_extent(quotip, &quotip->i_df, start, &idx, &got)) {
++ if (xfs_iext_lookup_extent(quotip, &quotip->i_df, start, &cur, &got)) {
+ /* contiguous chunk, bump startoff for the id calculation */
+ if (got.br_startoff < start)
+ got.br_startoff = start;
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -389,7 +389,7 @@
diff --git a/patches.fixes/xfs-fix-contiguous-dquot-chunk-iteration-livelock.patch b/patches.fixes/xfs-fix-contiguous-dquot-chunk-iteration-livelock.patch
new file mode 100644
index 0000000000..f8884d843a
--- /dev/null
+++ b/patches.fixes/xfs-fix-contiguous-dquot-chunk-iteration-livelock.patch
@@ -0,0 +1,59 @@
+From 2192b0baea395274ffcd38ec70e284389e3c243d Mon Sep 17 00:00:00 2001
+From: Brian Foster <bfoster@redhat.com>
+Date: Wed, 5 Jul 2017 12:07:52 -0700
+Subject: [PATCH] xfs: fix contiguous dquot chunk iteration livelock
+Git-commit: 2192b0baea395274ffcd38ec70e284389e3c243d
+Patch-mainline: v4.13-rc1
+References: bsc#1070995
+
+The patch below updated xfs_dq_get_next_id() to use the XFS iext
+lookup helpers to locate the next quota id rather than to seek for
+data in the quota file. The updated code fails to correctly handle
+the case where the quota inode might have contiguous chunks part of
+the same extent. In this case, the start block offset is calculated
+based on the next expected id but the extent lookup returns the same
+start offset as for the previous chunk. This causes the returned id
+to go backwards and livelocks the quota iteration. This problem is
+reproduced intermittently by generic/232.
+
+To handle this case, check whether the startoff from the extent
+lookup is behind the startoff calculated from the next quota id. If
+so, bump up got.br_startoff to the specific file offset that is
+expected to hold the next dquot chunk.
+
+Fixes: bda250dbaf39 ("xfs: rewrite xfs_dq_get_next_id using xfs_iext_lookup_extent")
+Signed-off-by: Brian Foster <bfoster@redhat.com>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
+Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
+Acked-by: Anthony Iliopoulos <ailiopoulos@suse.com>
+
+---
+ fs/xfs/xfs_dquot.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
+index 8848b397e7a8..f89f7b5241e6 100644
+--- a/fs/xfs/xfs_dquot.c
++++ b/fs/xfs/xfs_dquot.c
+@@ -733,10 +733,15 @@ xfs_dq_get_next_id(
+ return error;
+ }
+
+- if (xfs_iext_lookup_extent(quotip, &quotip->i_df, start, &idx, &got))
++ if (xfs_iext_lookup_extent(quotip, &quotip->i_df, start, &idx, &got)) {
++ /* contiguous chunk, bump startoff for the id calculation */
++ if (got.br_startoff < start)
++ got.br_startoff = start;
+ *id = got.br_startoff * mp->m_quotainfo->qi_dqperchunk;
+- else
++ } else {
+ error = -ENOENT;
++ }
++
+ xfs_iunlock(quotip, lock_flags);
+
+ return error;
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index aefb0cdee6..bc9837935a 100644
--- a/series.conf
+++ b/series.conf
@@ -3563,6 +3563,7 @@
patches.fixes/vfs-Add-page_cache_seek_hole_data-helper.patch
patches.fixes/vfs-Add-iomap_seek_hole-and-iomap_seek_data-helpers.patch
patches.fixes/xfs-Switch-to-iomap-for-SEEK_HOLE-SEEK_DATA.patch
+ patches.fixes/xfs-fix-contiguous-dquot-chunk-iteration-livelock.patch
patches.drivers/ipmi_ssif-unlock-on-allocation-failure
patches.drivers/0007-ipmi_ssif-remove-redundant-null-check-on-array-clien.patch
patches.drivers/0008-ipmi-Use-the-proper-default-value-for-register-size-.patch