From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Ryan Finnie" Subject: Re: msync(2) bug(?), returns AOP_WRITEPAGE_ACTIVATE to userland Date: Sun, 7 Oct 2007 18:58:54 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "Erez Zadok" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, "Colin Watson" To: "Pekka J Enberg" Return-path: Received: from py-out-1112.google.com ([64.233.166.176]:61518 "EHLO py-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753024AbXJHB64 (ORCPT ); Sun, 7 Oct 2007 21:58:56 -0400 Received: by py-out-1112.google.com with SMTP id u77so2124134pyb for ; Sun, 07 Oct 2007 18:58:56 -0700 (PDT) In-Reply-To: Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On 10/7/07, Pekka J Enberg wrote: > On 10/7/07, Erez Zadok wrote: > > Anyway, some Ubuntu users of Unionfs reported that msync(2) sometimes > > returns AOP_WRITEPAGE_ACTIVATE (decimal 524288) back to userland. > > Therefore, some user programs fail, esp. if they're written such as > > this: > ... > It's a kernel bug. AOP_WRITEPAGE_ACTIVATE is a hint to the VM to avoid > writeback of the page in the near future. I wonder if it's enough that we > change the return value to zero from > mm/page-writeback.c:write_cache_pages() in case we hit AOP_WRITEPAGE_ACTIVE... Doesn't appear to be enough. I can't figure out why (since it appears write_cache_pages bubbles up directly to sys_msync), but with that patch applied, in my test case[1], msync returns -1 EIO. However, with the exact same kernel without that patch applied, msync returns 524288 (AOP_WRITEPAGE_ACTIVATE). But as your patch specifically flips 524288 to 0, I can't figure out how it eventually returns -1 EIO. Ryan [1] "apt-get check" on a unionfs2 mount backed by tmpfs over cdrom, standard livecd setup