[lxc-devel] [PATCH] show additional info if btrfs subvolume deletion fails (issue #315)

Serge Hallyn serge.hallyn at ubuntu.com
Fri Aug 22 18:50:19 UTC 2014


Quoting S.Çağlar Onur (caglar at 10ur.org):
> Unprivileged users require "-o user_subvol_rm_allowed" mount option for btrfs.
> Make the INFO level message to ERROR to make it clear, which now says following;
> 
> [caglar at qop:~] lxc-destroy -n rubik
> lxc_container: Is the rootfs mounted with -o user_subvol_rm_allowed?
> lxc_container: Error destroying rootfs for rubik
> Destroying rubik failed
> 
> Signed-off-by: S.Çağlar Onur <caglar at 10ur.org>

Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

> ---
>  src/lxc/bdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c
> index e4b32a1..4fc10f2 100644
> --- a/src/lxc/bdev.c
> +++ b/src/lxc/bdev.c
> @@ -1552,7 +1552,7 @@ static int btrfs_do_destroy_subvol(const char *path)
>  	ret = ioctl(fd, BTRFS_IOC_SNAP_DESTROY, &args);
>  	INFO("btrfs: snapshot destroy ioctl returned %d for %s", ret, path);
>  	if (ret < 0 && errno == EPERM)
> -		INFO("Is the rootfs mounted with -o user_subvol_rm_allowed?");
> +		ERROR("Is the rootfs mounted with -o user_subvol_rm_allowed?");
>  
>  	free(newfull);
>  	close(fd);
> -- 
> 1.9.1
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel


More information about the lxc-devel mailing list