From mboxrd@z Thu Jan 1 00:00:00 1970 From: Badari Pulavarty Subject: Re: eCryptfs: Request for review Date: Fri, 21 Oct 2005 15:49:59 -0700 Message-ID: <1129934999.16301.60.camel@localhost.localdomain> References: <20051018193811.GA11545@halcrow.us> <1129736164.25733.19.camel@polarbear.fsl.cs.sunysb.edu> <1129750686.29319.7.camel@polarbear.fsl.cs.sunysb.edu> <1129757915.8716.29.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: "Charles P. Wright" , Michael Halcrow , linux-fsdevel@vger.kernel.org Return-path: Received: from wproxy.gmail.com ([64.233.184.207]:3467 "EHLO wproxy.gmail.com") by vger.kernel.org with ESMTP id S1751255AbVJUWui (ORCPT ); Fri, 21 Oct 2005 18:50:38 -0400 Received: by wproxy.gmail.com with SMTP id i4so94079wra for ; Fri, 21 Oct 2005 15:50:37 -0700 (PDT) To: Michael Thompson In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Fri, 2005-10-21 at 16:44 -0500, Michael Thompson wrote: > On 10/19/05, Badari Pulavarty wrote: > > It is telling you that there is already IO in progress on that page. > > Either you ended up in __block_write_full_page() twice or called > > __block_write_full_page() before finishing up end_page_writeback(). > > OK, I have narrowed it down to the following: we are in > ecryptfs_writepage, and do the following: > lower_page = grab_cache_page(lower_inode->i_mapping, 0); > where lower_page is the page in the lower filesysetm we want to write to. > > We consistantly panic when, after we do the grab_cache_page(), we have > a locked page which is set for PageWriteback.... > PageWriteback(lower_page) != 0. > > What I would like to know is how I should proceed when I am in this > condition. I am not sure if it is acceptable to simply return from the > function, or if I need to set some flags, or wait on the lock to free > up. Unfortunately, I haven't been digging around the VFS long enough > to know what makes sense in this case. I have not looked at your code fully - forgive me if doesn't make any sense to you. Why is "lower_page" is under writeback currently ? Is it that, file got modified underneath eCryptfs ? Or may be, you need to do wait_on_page_writeback(lowerpage) in your ecryptfs_commit_write() after grabbing lower page and before calling prepare-write on lower page. Makes any sense ? My head hurts thinking about it :) Thanks, Badari