All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Jiang Biao <jiang.biao2-Th6q7B73Y6EnDS1+zs4M5A@public.gmane.org>
Subject: Re: [PATCH] cifs: bugfix for unreclaimed writeback pages in cifs_writev_requeue()
Date: Thu, 7 Feb 2013 06:39:57 -0500	[thread overview]
Message-ID: <20130207063957.520a40c2@tlielax.poochiereds.net> (raw)
In-Reply-To: <CAH2r5muZL8voikW6NO_KojjV=N9zVymsqcR_KMf=XgZ4v8oGgQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Wed, 6 Feb 2013 12:00:08 -0600
Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> Forwarding to the current cifs development mailing list
> 
> 
> ---------- Forwarded message ----------
> From:  <jiang.biao2-Th6q7B73Y6EnDS1+zs4M5A@public.gmane.org>
> Date: Wed, Feb 6, 2013 at 12:26 AM
> Subject: [PATCH] cifs: bugfix for unreclaimed writeback pages in
> cifs_writev_requeue()
> To: Steve French <sfrench-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>, linux-cifs-client-w/Ol4Ecudplf7j03Gpi2xA@public.gmane.orgrg
> 
> 
> 
>     This patch applies to the kernel version of linux-3.8-rc6.
> 
>     Pages get the PG_writeback flag set before cifs sends its request
> to SMB server
>     in cifs_writepages(), if the SMB service goes down, cifs may try
> to recommit the
>     writing requests in cifs_writev_requeue(). However, it does not
> clean its PG_writeback
>     flag and relaimed the pages even if it fails again in
> cifs_writev_requeue(), which
>     may lead to the hanging of the processes accessing the cifs
> directory. This patch
>     just cleans the PG_writeback flags and reclaims the pages under
> that circumstances.
> 
>     Steps to reproduce the bug(trying serveral times may trigger the issue):
>     1.Write from cifs client continuously.(e.g dd if=/dev/zero of=<cifs file>)
>     2.Stop SMB service from server.(e.g service smb stop)
>     3.Wait for two minutes, and then start SMB service from
> server.(e.g service smb start)
>     4.The processes which are accessing cifs directory may hang up.
> 
>     Signed-off-by: Ouyang Maochun <ouyang.maochun-Th6q7B73Y6EnDS1+zs4M5A@public.gmane.org>
>     Signed-off-by: Jiang Yong <jian.yong5-Th6q7B73Y6EnDS1+zs4M5A@public.gmane.org>
>     Tested-by: Zhang Xianwei <zhang.xianwei8-Th6q7B73Y6EnDS1+zs4M5A@public.gmane.org>
>     Reviewed-by: Wang Liang <wang.liang82-Th6q7B73Y6EnDS1+zs4M5A@public.gmane.org>
>     Reviewed-by: Cai Qu <cai.qu-Th6q7B73Y6EnDS1+zs4M5A@public.gmane.org>
>     Reviewed-by: Jiang Biao <jiang.biao2-Th6q7B73Y6EnDS1+zs4M5A@public.gmane.org>
> 
> diff -uprN linux-3.8-rc6/fs/cifs/cifssmb.c linux-3.8-rc6_new/fs/cifs/cifssmb.c
> --- linux-3.8-rc6/fs/cifs/cifssmb.c        2013-02-01 09:08:14.000000000 +0800
> +++ linux-3.8-rc6_new/fs/cifs/cifssmb.c        2013-02-04
> 15:44:09.869254397 +0800
> @@ -1909,8 +1909,11 @@ cifs_writev_requeue(struct cifs_writedat
>          } while (rc == -EAGAIN);
> 
>          for (i = 0; i < wdata->nr_pages; i++) {
> -                if (rc != 0)
> +                if (rc != 0){
>                          SetPageError(wdata->pages[i]);
> +                         end_page_writeback(wdata->pages[i]);
> +                         page_cache_release(wdata->pages[i]);
> +                 }
>                  unlock_page(wdata->pages[i]);
>          }
> 
> 

Patch looks correct to me. Nice catch.

Reviewed-by: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

  parent reply	other threads:[~2013-02-07 11:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <OF08391DB5.0DFF1FA3-ON48257B0A.002333BE-48257B0A.002372B2@zte.com.cn>
     [not found] ` <OF08391DB5.0DFF1FA3-ON48257B0A.002333BE-48257B0A.002372B2-Th6q7B73Y6EnDS1+zs4M5A@public.gmane.org>
2013-02-06 18:00   ` Fwd: [PATCH] cifs: bugfix for unreclaimed writeback pages in cifs_writev_requeue() Steve French
     [not found]     ` <CAH2r5muZL8voikW6NO_KojjV=N9zVymsqcR_KMf=XgZ4v8oGgQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-06 18:26       ` Pavel Shilovsky
     [not found]         ` <OFA5D50D9D.206122F1-ON48257B0B.00139BCC-48257B0B.002214B3@zte.com.cn>
     [not found]           ` <OFA5D50D9D.206122F1-ON48257B0B.00139BCC-48257B0B.002214B3-Th6q7B73Y6EnDS1+zs4M5A@public.gmane.org>
2013-02-07  7:27             ` Pavel Shilovsky
     [not found]         ` <CAKywueRidM=aOdnxVsA3r0q33R7QnG1W87Eio6KiFOvTQB-ESQ@mail.gmail.com>
     [not found]           ` <CAKywueRidM=aOdnxVsA3r0q33R7QnG1W87Eio6KiFOvTQB-ESQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-03-01 23:57             ` Jeff Layton
     [not found]               ` <20130301185750.66a139ca-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2013-03-02  5:53                 ` Pavel Shilovsky
2013-02-07 11:39       ` Jeff Layton [this message]
     [not found]         ` <20130207063957.520a40c2-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2013-02-18 16:59           ` Steve French

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=20130207063957.520a40c2@tlielax.poochiereds.net \
    --to=jlayton-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=jiang.biao2-Th6q7B73Y6EnDS1+zs4M5A@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.