[PATCH] userns: fix return value in map_write
gaofeng at cn.fujitsu.com
Wed Oct 10 04:28:20 UTC 2012
于 2012年10月10日 12:06, Eric W. Biederman 写道:
> Gao feng <gaofeng at cn.fujitsu.com> writes:
>> If the map is already set,we should return -EINVAL.
> What makes -EINVAL a better return code?
It shouldn't be -EPERM,this will cause user confused.
The first time to write to the uid_map file is success,
and the second time,kernel will return -EPERM.actually
the user has right to write to the uid_map.
And if you think -EPERM is better,it's not necessary
to initialize the value of ret.because we set it to
-EPERM after we get mutex lock id_map_mutex.
More information about the Containers