public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Yihao Wu <wuyihao@linux.alibaba.com>
Cc: Jeff Layton <jlayton@kernel.org>,
	linux-nfs@vger.kernel.org, stable@vger.kernel.org,
	Joseph Qi <joseph.qi@linux.alibaba.com>
Subject: Re: [PATCH] nfsd: fix wrong check in write_v4_end_grace()
Date: Wed, 6 Mar 2019 09:58:49 -0500	[thread overview]
Message-ID: <20190306145849.GA2426@fieldses.org> (raw)
In-Reply-To: <22af6507-782d-d2fb-77f7-455dad27697f@linux.alibaba.com>

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

      reply	other threads:[~2019-03-06 14:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190306145849.GA2426@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=jlayton@kernel.org \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=wuyihao@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox