[Libguestfs] [PATCH] daemon: Run lsof when an umount command fails in umount_all call.

Pino Toscano ptoscano at redhat.com
Thu Jul 23 15:29:43 UTC 2015


On Thursday 23 July 2015 16:24:23 Richard W.M. Jones wrote:
> Useful for debugging unmount failures.  Note that we include lsof in
> the appliance already.
> ---
>  daemon/mount.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/daemon/mount.c b/daemon/mount.c
> index c5b7d89..e139482 100644
> --- a/daemon/mount.c
> +++ b/daemon/mount.c
> @@ -424,6 +424,10 @@ do_umount_all (void)
>      r = command (NULL, &err, str_umount, mounts.argv[i], NULL);
>      if (r == -1) {
>        reply_with_error ("umount: %s: %s", mounts.argv[i], err);
> +      if (verbose) {
> +        /* Try running lsof to see what is holding the mountpoint open. */
> +        command (NULL, NULL, "lsof", mounts.argv[i], NULL);
> +      }
>        free_stringslen (mounts.argv, mounts.size);
>        return -1;
>      }

LGTM. Maybe worth being done also on single umount API?

Thanks,
-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20150723/440c9d39/attachment.sig>


More information about the Libguestfs mailing list