Skip to contentSkip to conversation

libxfs: print the device name if flush-on-close fails

PATCH In review Darrick J. Wong 2 participants 2 messages Apr 17, 2024 – Apr 18, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxfs: print the device name if flush-on-close fails

From: Darrick J. Wong <[email protected]>

Print the name of the device if persisting the write cache fails. Printing a pointer does not help the user at all, and this causes the 32-bit build to complain:

init.c: In function ‘libxfs_device_close’:
init.c:178:35: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
178 | progname, (long long)dev, ret);
| ^
cc1: all warnings being treated as errors

Fixes fc83c7574b1f ("libxfs: split out a libxfs_dev structure from struct libxfs_init")
---
 libxfs/init.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
libxfs/init.c +2 -2
index 1e035c48f57f..6ac9d682490a 100644
@@ -171,8 +171,8 @@ libxfs_device_close(
 	if (ret) {
 		ret = -errno;
 		fprintf(stderr,
-	_("%s: flush of device %lld failed, err=%d"),
-			progname, (long long)dev, ret);
+	_("%s: flush of device %s failed, err=%d"),
+			progname, dev->name, ret);
 	}
 	close(dev->fd);