From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753011AbbIPRrV (ORCPT ); Wed, 16 Sep 2015 13:47:21 -0400 Received: from mail-yk0-f181.google.com ([209.85.160.181]:35702 "EHLO mail-yk0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752335AbbIPRrT (ORCPT ); Wed, 16 Sep 2015 13:47:19 -0400 Date: Wed, 16 Sep 2015 13:47:15 -0400 From: Tejun Heo To: Junichi Nomura Cc: "linux-kernel@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" , "akpm@linux-foundation.org" , "andi@firstfloor.org" , "fengguang.wu@intel.com" , "tony.luck@intel.com" , "david@fromorbit.com" , Naoya Horiguchi Subject: Re: [PATCH v2] fs: global sync to not clear error status of individual inodes Message-ID: <20150916174715.GF3243@mtj.duckdns.org> References: <20150915094638.GA13399@xzibit.linux.bs1.fc.nec.co.jp> <20150915095412.GD13399@xzibit.linux.bs1.fc.nec.co.jp> <20150915152006.GD2905@mtj.duckdns.org> <20150916005916.GB6059@xzibit.linux.bs1.fc.nec.co.jp> <20150916083908.GA12244@xzibit.linux.bs1.fc.nec.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150916083908.GA12244@xzibit.linux.bs1.fc.nec.co.jp> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 16, 2015 at 08:39:09AM +0000, Junichi Nomura wrote: > filemap_fdatawait() is a function to wait for on-going writeback > to complete but also consume and clear error status of the mapping > set during writeback. > The latter functionality is critical for applications to detect > writeback error with system calls like fsync(2)/fdatasync(2). > > However filemap_fdatawait() is also used by sync(2) or FIFREEZE > ioctl, which don't check error status of individual mappings. > > As a result, fsync() may not be able to detect writeback error > if events happen in the following order: > > Application System admin > ---------------------------------------------------------- > write data on page cache > Run sync command > writeback completes with error > filemap_fdatawait() clears error > fsync returns success > (but the data is not on disk) > > This patch adds filemap_fdatawait_keep_errors() for call sites where > writeback error is not handled so that they don't clear error status. > > Signed-off-by: Jun'ichi Nomura > Acked-by: Andi Kleen Reviewed-by: Tejun Heo Thanks. -- tejun