xfs
[Top] [All Lists]

Re: [PATCH 1 of 2] Implement generic block_page_mkwrite() functionality

To: Chris Mason <chris.mason@xxxxxxxxxx>
Subject: Re: [PATCH 1 of 2] Implement generic block_page_mkwrite() functionality
From: Nick Piggin <nickpiggin@xxxxxxxxxxxx>
Date: Thu, 08 Feb 2007 13:34:00 +1100
Cc: David Chinner <dgc@xxxxxxx>, Hugh Dickins <hugh@xxxxxxxxxxx>, xfs@xxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.au; h=Received:X-YMail-OSG:Message-ID:Date:From:User-Agent:X-Accept-Language:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=qHgqfAxy3RyO6YTtHHLe6bsgDC8bcdXqgQwS8lYZrnbtifOzmcIlRTxtVxjWTNoKK6uJ9rp7Md6r6UFtJQ3RRSjP9LZYtHKAtgukg5Bls7+cWsyF6uMwsRfSFYRVfDloclMgMIYymovTOvn7nAIWxS81lpmZkEMwzUt+gmYVpNk= ;
In-reply-to: <20070207155245.GB11967@think.oraclecorp.com>
References: <20070207124922.GK44411608@melbourne.sgi.com> <Pine.LNX.4.64.0702071256530.25060@blonde.wat.veritas.com> <20070207144415.GN44411608@melbourne.sgi.com> <20070207155245.GB11967@think.oraclecorp.com>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051007 Debian/1.7.12-1
Chris Mason wrote:
On Thu, Feb 08, 2007 at 01:44:15AM +1100, David Chinner wrote:

So, do I need to grab the i_mutex here? Is that safe to do that in
the middle of a page fault? If we do race with a truncate and the
page is now beyond EOF, what am I supposed to return?


Should it check to make sure the page is still in the address space
after locking it?

Yes. If the page was truncated/invalidated, then you can just return and the pagefault handler should notice that it has been removed from the page tables.

--
SUSE Labs, Novell Inc.

Send instant messages to your online friends http://au.messenger.yahoo.com


<Prev in Thread] Current Thread [Next in Thread>