summaryrefslogtreecommitdiff
path: root/fs/nfsd
diff options
context:
space:
mode:
authorYihao Wu <wuyihao@linux.alibaba.com>2019-03-06 16:03:50 +0300
committerJ. Bruce Fields <bfields@redhat.com>2019-03-06 17:58:20 +0300
commitdd838821f0a29781b185cd8fb8e48d5c177bd838 (patch)
tree426405e03364e391bd2ae17fdafe19e8c8ffda39 /fs/nfsd
parentb602345da6cbb135ba68cf042df8ec9a73da7981 (diff)
downloadlinux-dd838821f0a29781b185cd8fb8e48d5c177bd838.tar.xz
nfsd: fix wrong check in write_v4_end_grace()
Commit 62a063b8e7d1 "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: 62a063b8e7d1 "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>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfsctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index b33f9785b756..ff14c29d01e9 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -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;