mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 22:54:05 +08:00
NFSD: handle errors better in write_ports_addfd()
If write_ports_add() fails, we shouldn't destroy the serv, unless we had only just created it. So if there are any permanent sockets already attached, leave the serv in place. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
parent
c2f1c4bd20
commit
89b24336f0
@ -742,7 +742,7 @@ static ssize_t __write_ports_addfd(char *buf, struct net *net, const struct cred
|
||||
return err;
|
||||
|
||||
err = svc_addsock(nn->nfsd_serv, fd, buf, SIMPLE_TRANSACTION_LIMIT, cred);
|
||||
if (err < 0) {
|
||||
if (err < 0 && list_empty(&nn->nfsd_serv->sv_permsocks)) {
|
||||
nfsd_destroy(net);
|
||||
return err;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user