From 9d6a3ee547a404cee49303ce12a550e79ca1680f Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Thu, 19 Sep 2024 13:40:09 +0200 Subject: [PATCH] filesystem: add note about swap devices --- lib/device/filesystem.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/device/filesystem.c b/lib/device/filesystem.c index 18d7760bd..53bb3ca07 100644 --- a/lib/device/filesystem.c +++ b/lib/device/filesystem.c @@ -201,6 +201,13 @@ int fs_get_info(struct cmd_context *cmd, struct logical_volume *lv, if (!include_mount) return 1; + /* + * Note: used swap devices are not considered as mount points, + * hence they're not listed in /etc/mtab, we'd need to read the + * /proc/swaps instead. We don't need it at this moment though, + * but if we do once, read the /proc/swaps here if fsi->fstype == "swap". + */ + if (!(fme = setmntent("/etc/mtab", "r"))) return_0;