Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd467696 authored by Mike Snitzer's avatar Mike Snitzer
Browse files

dm thin: fail messages with EOPNOTSUPP when pool cannot handle messages



Use EOPNOTSUPP, rather than EINVAL, error code when user attempts to
send the pool a message.  Otherwise usespace is led to believe the
message failed due to invalid argument.

Reported-by: default avatarZdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 34fbcf62
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -3656,7 +3656,7 @@ static int pool_message(struct dm_target *ti, unsigned argc, char **argv)
	if (get_pool_mode(pool) >= PM_READ_ONLY) {
	if (get_pool_mode(pool) >= PM_READ_ONLY) {
		DMERR("%s: unable to service pool target messages in READ_ONLY or FAIL mode",
		DMERR("%s: unable to service pool target messages in READ_ONLY or FAIL mode",
		      dm_device_name(pool->pool_md));
		      dm_device_name(pool->pool_md));
		return -EINVAL;
		return -EOPNOTSUPP;
	}
	}


	if (!strcasecmp(argv[0], "create_thin"))
	if (!strcasecmp(argv[0], "create_thin"))