Skip to content

Commit

Permalink
nfsd: fix wrong check in write_v4_end_grace()
Browse files Browse the repository at this point in the history
Commit 62a063b "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: 62a063b "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>
  • Loading branch information
Yihao Wu authored and J. Bruce Fields committed Mar 6, 2019
1 parent b602345 commit dd83882
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfsd/nfsctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dd83882

Please sign in to comment.