]> git.pld-linux.org Git - packages/xfsprogs.git/commitdiff
- rel 2; fix deadlock auto/th/xfsprogs-4.19.0-2
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Wed, 6 Feb 2019 07:17:58 +0000 (08:17 +0100)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Wed, 6 Feb 2019 07:17:58 +0000 (08:17 +0100)
xfsprogs-small_fixes.patch [new file with mode: 0644]
xfsprogs.spec

diff --git a/xfsprogs-small_fixes.patch b/xfsprogs-small_fixes.patch
new file mode 100644 (file)
index 0000000..2887ba9
--- /dev/null
@@ -0,0 +1,65 @@
+From: Dave Chinner <dchinner@redhat.com>\r
+\r
+If inode_item_done() fails to flush an inode after we've grabbed a\r
+reference to the underlying buffer during a transaction commit, we\r
+fail to put the buffer and hence leak it. We then deadlock on the\r
+next lookup ofthe inode buffer as it is still locked and no-one owns\r
+it.\r
+\r
+To fix it, put the buffer on error so that it gets unlocked and\r
+can be recovered appropriately in a later phase of repair.\r
+\r
+Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl>\r
+Fixes: d15188a1ec14 ("xfs: rework the inline directory verifiers")\r
+Signed-off-by: Dave Chinner <dchinner@redhat.com>\r
+---\r
+ libxfs/trans.c | 17 +++++++++++++----\r
+ 1 file changed, 13 insertions(+), 4 deletions(-)\r
+\r
+diff --git a/libxfs/trans.c b/libxfs/trans.c\r
+index 46ff8b4ae798..10a35dd47b01 100644\r
+--- a/libxfs/trans.c\r
++++ b/libxfs/trans.c\r
+@@ -824,8 +824,10 @@ _("Transaction block reservation exceeded! %u > %u\n"),\r
\r
+ /*\r
+  * Transaction commital code follows (i.e. write to disk in libxfs)\r
++ *\r
++ * XXX (dgc): should failure to flush the inode (e.g. due to uncorrected\r
++ * corruption) result in transaction commit failure w/ EFSCORRUPTED?\r
+  */\r
+-\r
+ static void\r
+ inode_item_done(\r
+       xfs_inode_log_item_t    *iip)\r
+@@ -856,17 +858,24 @@ inode_item_done(\r
+               return;\r
+       }\r
\r
++      /*\r
++       * Flush the inode and disassociate it from the transaction regardless\r
++       * of whether the flush succeed or not. If we fail the flush, make sure\r
++       * we still release the buffer reference we currently hold.\r
++       */\r
+       bp->b_log_item = iip;\r
+       error = libxfs_iflush_int(ip, bp);\r
++      ip->i_transp = NULL;    /* disassociate from transaction */\r
++      bp->b_log_item = NULL;  /* remove log item */\r
++      bp->b_transp = NULL;    /* remove xact ptr */\r
++\r
+       if (error) {\r
+               fprintf(stderr, _("%s: warning - iflush_int failed (%d)\n"),\r
+                       progname, error);\r
++              libxfs_putbuf(bp);\r
+               return;\r
+       }\r
\r
+-      ip->i_transp = NULL;    /* disassociate from transaction */\r
+-      bp->b_log_item = NULL;  /* remove log item */\r
+-      bp->b_transp = NULL;    /* remove xact ptr */\r
+       libxfs_writebuf(bp, 0);\r
+ #ifdef XACT_DEBUG\r
+       fprintf(stderr, "flushing dirty inode %llu, buffer %p\n",\r
+-- \r
+2.20.1\r
+\r
index bfb307089d8f74dfa005fcef812a58470769e518..4bf4f77bc468592042d60aaeef2063fda7367357 100644 (file)
@@ -6,7 +6,7 @@ Summary:        Tools for the XFS filesystem
 Summary(pl.UTF-8):     Narzędzia do systemu plików XFS
 Name:          xfsprogs
 Version:       4.19.0
 Summary(pl.UTF-8):     Narzędzia do systemu plików XFS
 Name:          xfsprogs
 Version:       4.19.0
-Release:       1
+Release:       2
 License:       LGPL v2.1 (libhandle), GPL v2 (the rest)
 Group:         Applications/System
 Source0:       https://www.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/%{name}-%{version}.tar.gz
 License:       LGPL v2.1 (libhandle), GPL v2 (the rest)
 Group:         Applications/System
 Source0:       https://www.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/%{name}-%{version}.tar.gz
@@ -14,6 +14,7 @@ Source0:      https://www.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/%{name}-%{versio
 Source1:       xfs_lsprojid
 Patch0:                %{name}-miscfix-v2.patch
 Patch1:                %{name}-pl.po-update.patch
 Source1:       xfs_lsprojid
 Patch0:                %{name}-miscfix-v2.patch
 Patch1:                %{name}-pl.po-update.patch
+Patch2:                xfsprogs-small_fixes.patch
 # Patch1-md5:  28832d2c0aefb92ec17ebfe924c156e3
 URL:           http://www.xfs.org/
 BuildRequires: autoconf >= 2.50
 # Patch1-md5:  28832d2c0aefb92ec17ebfe924c156e3
 URL:           http://www.xfs.org/
 BuildRequires: autoconf >= 2.50
@@ -108,6 +109,7 @@ Biblioteki statyczne do XFS.
 %setup -q
 %patch0 -p1
 %patch1 -p1
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' scrub/xfs_scrub_all.in tools/xfsbuflock.py
 
 
 %{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' scrub/xfs_scrub_all.in tools/xfsbuflock.py
 
This page took 0.197912 seconds and 4 git commands to generate.