blockd: report "target" path as "mount" for autofs available mounts
authorRafał Miłecki <rafal@milecki.pl>
Fri, 27 Dec 2019 12:09:11 +0000 (13:09 +0100)
committerRafał Miłecki <rafal@milecki.pl>
Sat, 21 Mar 2020 21:40:52 +0000 (22:40 +0100)
Devices handled with autofs should be seen as available even if
currently unmounted. Mounting is handled on demand and transparently for
users.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
blockd.c

index a04ea5bf4b2831281376fc9609f60cc32f85869a..84bea6e9c8df5f7b08e5e61719c42cfbb6be1a76 100644 (file)
--- a/blockd.c
+++ b/blockd.c
@@ -283,6 +283,8 @@ block_info(struct ubus_context *ctx, struct ubus_object *obj,
                if (mp) {
                        blobmsg_add_string(&bb, "mount", mp);
                        free(mp);
+               } else if (device->autofs && device->target) {
+                       blobmsg_add_string(&bb, "mount", device->target);
                }
                blobmsg_close_table(&bb, t);
        }