From: Steve French Date: Mon, 18 Feb 2013 15:54:52 +0000 (-0600) Subject: cifs: bugfix for unreclaimed writeback pages in cifs_writev_requeue() X-Git-Tag: next-20130220~97^2~2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=87eadfbc5f0af23c8b6c30063eb1f67452b38bae;p=karo-tx-linux.git cifs: bugfix for unreclaimed writeback pages in cifs_writev_requeue() 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=) 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 Signed-off-by: Jiang Yong Tested-by: Zhang Xianwei Reviewed-by: Wang Liang Reviewed-by: Cai Qu Reviewed-by: Jiang Biao Reviewed-by: Jeff Layton Reviewed-by: Pavel Shilovsky Signed-off-by: Steve French --- diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 76d0d2998850..9b121c50eb20 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -1909,8 +1909,11 @@ cifs_writev_requeue(struct cifs_writedata *wdata) } 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]); }