diff --git a/cmds/subvolume.c b/cmds/subvolume.c index 8bb21f9f..9e5e1411 100644 --- a/cmds/subvolume.c +++ b/cmds/subvolume.c @@ -652,9 +652,11 @@ static int cmd_subvolume_snapshot(const struct cmd_struct *cmd, int argc, char * strncpy_null(args.name, newname); res = ioctl(fddst, BTRFS_IOC_SNAP_CREATE_V2, &args); - if (res < 0) { - error("cannot snapshot '%s': %m", subvol); + if (errno == ETXTBSY) + error("cannot snapshot '%s': source subvolume contains an active swapfile (%m)", subvol); + else + error("cannot snapshot '%s': %m", subvol); goto out; }