From patchwork Wed Dec 8 02:35:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 389412 X-Patchwork-Delegate: Trond.Myklebust@netapp.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB82XgPp023272 for ; Wed, 8 Dec 2010 02:33:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755773Ab0LHCdl (ORCPT ); Tue, 7 Dec 2010 21:33:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50557 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755744Ab0LHCdk (ORCPT ); Tue, 7 Dec 2010 21:33:40 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oB82XbQU023938 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 7 Dec 2010 21:33:37 -0500 Received: from corrin.poochiereds.net (vpn-9-202.rdu.redhat.com [10.11.9.202]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oB82XZuS026292; Tue, 7 Dec 2010 21:33:36 -0500 Date: Tue, 7 Dec 2010 21:35:40 -0500 From: Jeff Layton To: Trond Myklebust Cc: linux-nfs@vger.kernel.org Subject: Re: oops in nfs_flush_incompatible (and possible fix?) Message-ID: <20101207213540.441330db@corrin.poochiereds.net> In-Reply-To: <20101207200344.68ff29e3@corrin.poochiereds.net> References: <20101206145743.4464c79d@tlielax.poochiereds.net> <1291758082.3049.42.camel@heimdal.trondhjem.org> <20101207165354.32c863f2@tlielax.poochiereds.net> <1291768200.3049.51.camel@heimdal.trondhjem.org> <20101207200344.68ff29e3@corrin.poochiereds.net> Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 08 Dec 2010 02:33:43 +0000 (UTC) diff --git a/fs/nfs/read.c b/fs/nfs/read.c index e4b62c6..aedcaa7 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c @@ -152,7 +152,6 @@ static void nfs_readpage_release(struct nfs_page *req) (long long)NFS_FILEID(req->wb_context->path.dentry->d_inode), req->wb_bytes, (long long)req_offset(req)); - nfs_clear_request(req); nfs_release_request(req); } diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 4c14c17..04857c0 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -407,14 +407,16 @@ out: */ static void nfs_inode_remove_request(struct nfs_page *req) { + struct page *page; struct inode *inode = req->wb_context->path.dentry->d_inode; struct nfs_inode *nfsi = NFS_I(inode); BUG_ON (!NFS_WBACK_BUSY(req)); spin_lock(&inode->i_lock); - set_page_private(req->wb_page, 0); - ClearPagePrivate(req->wb_page); + page = xchg(&req->wb_page, NULL); + set_page_private(page, 0); + ClearPagePrivate(page); radix_tree_delete(&nfsi->nfs_page_tree, req->wb_index); nfsi->npages--; if (!nfsi->npages) { @@ -422,7 +424,8 @@ static void nfs_inode_remove_request(struct nfs_page *req) iput(inode); } else spin_unlock(&inode->i_lock); - nfs_clear_request(req); + if (page != NULL) + page_cache_release(page); nfs_release_request(req); }