linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nfsd: fix wrong check in write_v4_end_grace()
@ 2019-03-06 13:47 Yihao Wu
  2019-03-06 14:58 ` J. Bruce Fields
  0 siblings, 1 reply; 2+ messages in thread
From: Yihao Wu @ 2019-03-06 13:47 UTC (permalink / raw)
  To: J. Bruce Fields, Jeff Layton, linux-nfs; +Cc: stable, Joseph Qi

From 04ddefd79a5cd410d65b7a30593ac915b9fab687 Mon Sep 17 00:00:00 2001
From: Yihao Wu <wuyihao@linux.alibaba.com>
Date: Wed, 6 Mar 2019 21:03:50 +0800
Subject: [PATCH] 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>
---
 fs/nfsd/nfsctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 72a7681..f2feb2d 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;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] nfsd: fix wrong check in write_v4_end_grace()
  2019-03-06 13:47 [PATCH] nfsd: fix wrong check in write_v4_end_grace() Yihao Wu
@ 2019-03-06 14:58 ` J. Bruce Fields
  0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2019-03-06 14:58 UTC (permalink / raw)
  To: Yihao Wu; +Cc: Jeff Layton, linux-nfs, stable, Joseph Qi

On Wed, Mar 06, 2019 at 09:47:14PM +0800, Yihao Wu wrote:
> >From 04ddefd79a5cd410d65b7a30593ac915b9fab687 Mon Sep 17 00:00:00 2001
> From: Yihao Wu <wuyihao@linux.alibaba.com>
> Date: Wed, 6 Mar 2019 21:03:50 +0800
> Subject: [PATCH] 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.

Applied, thanks!--b.

> 
> 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>
> ---
>  fs/nfsd/nfsctl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
> index 72a7681..f2feb2d 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;
> -- 
> 1.8.3.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-06 14:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-06 13:47 [PATCH] nfsd: fix wrong check in write_v4_end_grace() Yihao Wu
2019-03-06 14:58 ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).