Skip to content

Commit dd83882

Browse files
Yihao WuJ. Bruce Fields
authored andcommitted
nfsd: fix wrong check in write_v4_end_grace()
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>
1 parent b602345 commit dd83882

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfsd/nfsctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ static ssize_t write_v4_end_grace(struct file *file, char *buf, size_t size)
11261126
case 'Y':
11271127
case 'y':
11281128
case '1':
1129-
if (nn->nfsd_serv)
1129+
if (!nn->nfsd_serv)
11301130
return -EBUSY;
11311131
nfsd4_end_grace(nn);
11321132
break;

0 commit comments

Comments
 (0)