FS#26059 - util-linux 2.20 has broken UUID detection causing nfs mountd to fail.

Attached to Project: Arch Linux
Opened by Clemens Fruhwirth (therp) - Sunday, 18 September 2011, 21:38 GMT
Last edited by Tom Gundersen (tomegun) - Monday, 19 September 2011, 22:03 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Tom Gundersen (tomegun)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Please add the following patch to util-linux-2.20. The UUID detection function for sysfs breaks all the following, as it closes the file descriptor it gets handed. The patch fixes this behaviour.

Symptoms of this bug are failing nfs mounts.
Aug 25 11:50:32 pc-diego rpc.mountd[10423]: authenticated mount request from
192.168.10.59:819 for /dati/ISO (/dati/ISO)
Aug 25 11:50:32 pc-diego rpc.mountd[10423]: qword_eol: fflush failed: errno 9
(Bad file descriptor)
Aug 25 11:50:32 pc-diego rpc.mountd[10423]: Cannot export /dati/ISO, possibly
unsupported filesystem or fsid= required

Source: https://build.opensuse.org/request/show/81983

--- util-linux-lib-sysfs-deinit.patch (added)
+++ util-linux-lib-sysfs-deinit.patch (revision 2befd46bd2b4bb757568f00db3019a4a)
@@ -0,0 +1,29 @@
+From cf06399d6aeb1e558baf2b46b617496ed7aac81c Mon Sep 17 00:00:00 2001
+From: Petr Uzel <petr.uzel@suse.cz>
+Date: Mon, 12 Sep 2011 16:11:41 +0200
+Subject: [PATCH] lib: do not attempt to close(0) in sysfs_deinit()
+
+If the 'open' fails we 'goto err' which runs 'sysfs_deinit()' on a 'cxt'
+which hasn't been fully initialised. The 'dir_fd' is still 0, so
+sysfs_deinit calls "close(0)".
+
+Addresses: https://bugzilla.novell.com/show_bug.cgi?id=714151
+Reported-by: Diego Ercolani <diego.ercolani@gmail.com>
+Analysed-by: Neil Brown <nfbrown@suse.com>
+Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
+---
+ lib/sysfs.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+Index: util-linux-2.20/lib/sysfs.c
+===================================================================
+--- util-linux-2.20.orig/lib/sysfs.c
++++ util-linux-2.20/lib/sysfs.c
+@@ -140,6 +140,7 @@ int sysfs_init(struct sysfs_cxt *cxt, de
+ int fd, rc = 0;
+
+ memset(cxt, 0, sizeof(*cxt));
++ cxt->dir_fd = -1;
+
+ if (!sysfs_devno_path(devno, path, sizeof(path)))
+ goto err;
This task depends upon

Closed by  Tom Gundersen (tomegun)
Monday, 19 September 2011, 22:03 GMT
Reason for closing:  Fixed
Additional comments about closing:  In [testing]

Loading...