]> git.baikalelectronics.ru Git - kernel.git/commit
netns: fix error code when the nsid is already used
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Fri, 9 Jun 2017 12:41:57 +0000 (14:41 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 10 Jun 2017 19:58:50 +0000 (15:58 -0400)
commita75a0742d348b06360e2b82c0f0fb149b57b75ed
treeac279bdfda6a5b3340383e7c541beaff2350fa0a
parenta73272574058e41c21f8f88dcb2356ad263a0349
netns: fix error code when the nsid is already used

When the user tries to assign a specific nsid, idr_alloc() is called with
the range [nsid, nsid+1]. If this nsid is already used, idr_alloc() returns
ENOSPC (No space left on device). In our case, it's better to return
EEXIST to make it clear that the nsid is not available.

CC: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/net_namespace.c