public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: linux-nfs@vger.kernel.org, Weston Andros Adamson <dros@primarydata.com>
Subject: Re: [PATCH 2/2] NFS: Fix a bogus warning in nfs_generic_pgio
Date: Tue, 14 Oct 2014 17:22:12 -0400	[thread overview]
Message-ID: <543D9404.90006@RedHat.com> (raw)
In-Reply-To: <1413212839-6665-2-git-send-email-trond.myklebust@primarydata.com>



On 10/13/2014 11:07 AM, Trond Myklebust wrote:
> It is OK for pageused == pagecount in the loop, as long as we don't add
> another entry to the *pages array. Move the test so that it only triggers
> in that case.
> 
> Reported-by: Steve Dickson <SteveD@redhat.com>
> Fixes: bba5c1887a92 (nfs: disallow duplicate pages in pgio page vectors)
> Cc: Weston Andros Adamson <dros@primarydata.com>
> Cc: stable@vger.kernel.org # 3.16.x
> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Tested-by: Steve Dickson <steved@redhat.com>

steved.
> ---
>  fs/nfs/pagelist.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
> index 08085de879ed..ed0db61f8543 100644
> --- a/fs/nfs/pagelist.c
> +++ b/fs/nfs/pagelist.c
> @@ -752,12 +752,11 @@ int nfs_generic_pgio(struct nfs_pageio_descriptor *desc,
>  		nfs_list_remove_request(req);
>  		nfs_list_add_request(req, &hdr->pages);
>  
> -		if (WARN_ON_ONCE(pageused >= pagecount))
> -			return nfs_pgio_error(desc, hdr);
> -
>  		if (!last_page || last_page != req->wb_page) {
> -			*pages++ = last_page = req->wb_page;
>  			pageused++;
> +			if (pageused > pagecount)
> +				break;
> +			*pages++ = last_page = req->wb_page;
>  		}
>  	}
>  	if (WARN_ON_ONCE(pageused != pagecount))
> 

  parent reply	other threads:[~2014-10-14 21:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-13 15:07 [PATCH 1/2] NFS: Fix an uninitialised pointer Oops in the writeback error path Trond Myklebust
2014-10-13 15:07 ` [PATCH 2/2] NFS: Fix a bogus warning in nfs_generic_pgio Trond Myklebust
2014-10-13 15:25   ` Weston Andros Adamson
2014-10-14 21:22   ` Steve Dickson [this message]
2014-10-14 21:22 ` [PATCH 1/2] NFS: Fix an uninitialised pointer Oops in the writeback error path Steve Dickson

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=543D9404.90006@RedHat.com \
    --to=steved@redhat.com \
    --cc=dros@primarydata.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.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