nfsd: fix wrong check in write_v4_end_grace()

commit dd838821f0 upstream.

Commit 62a063b8e7 "nfsd4: fix crash on writing v4_end_grace before
nfsd startup" is trying to fix a NULL dereference issue, but it
mistakenly checks if the nfsd server is started. So fix it.

Fixes: 62a063b8e7 "nfsd4: fix crash on writing v4_end_grace before nfsd startup"
Cc: stable@vger.kernel.org
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: Yihao Wu <wuyihao@linux.alibaba.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Yihao Wu 2019-03-06 21:03:50 +08:00 committed by Greg Kroah-Hartman
parent c0edc30060
commit 2fa903f97d
1 changed files with 1 additions and 1 deletions

View File

@ -1126,7 +1126,7 @@ static ssize_t write_v4_end_grace(struct file *file, char *buf, size_t size)
case 'Y':
case 'y':
case '1':
if (nn->nfsd_serv)
if (!nn->nfsd_serv)
return -EBUSY;
nfsd4_end_grace(nn);
break;