From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Re: page locking and error handling References: From: ebiederm@xmission.com (Eric W. Biederman) Date: 15 Feb 2001 16:37:59 -0700 In-Reply-To: Roman Zippel's message of "Thu, 15 Feb 2001 19:50:09 +0100 (MET)" Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-linux-mm@kvack.org Return-Path: To: Roman Zippel Cc: linux-mm@kvack.org List-ID: Roman Zippel writes: > Hi, > > On 15 Feb 2001, Eric W. Biederman wrote: > > > > - if copy_from_user() fails the page is set as not uptodate. AFAIK this > > > assumes that the page->buffers are still uptodate, so previous writes > > > are not lost. > > If copy_from_user fails that invokes undefined behavior, and you just lost > > your previous writes because you ``overwrote'' them. > > What about partial writes? The important thing is if copy_from_user fails it is because of a buggy user space app. Because the buggy app passed a bad memory area. So you have undefined behavior, so you can do whatever is convenient. The only case to worry about how do we keep from breaking kernel invariants. I think it make break an invariant to set a mmaped page as not uptodate, but I can't see any other problems with the interface. Eric -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/