Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753713AbdDLMGZ (ORCPT ); Wed, 12 Apr 2017 08:06:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39236 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753457AbdDLMGR (ORCPT ); Wed, 12 Apr 2017 08:06:17 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 336FCC04B954 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jlayton@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 336FCC04B954 From: Jeff Layton To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, tytso@mit.edu, jack@suse.cz, willy@infradead.org, neilb@suse.com, viro@zeniv.linux.org.uk Subject: [PATCH v2 00/17] fs: introduce new writeback error reporting and convert existing API as a wrapper around it Date: Wed, 12 Apr 2017 08:05:57 -0400 Message-Id: <20170412120614.6111-1-jlayton@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 12 Apr 2017 12:06:16 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3871 Lines: 83 This is the second posting of this patchset. The basic idea with this set is to tighten up how we handle errors that occur during writeback. There are many places where writeback errors in the kernel can be lost today, which can cause silent data corruption. Also, the current method of clearing errors out of the mapping on fsync has always been something of a problem for userland. This replaces it with better defined semantics where userland can ensure that writeback errors are reported on all open file descriptors. In addition to incorporating review feedback (mostly from Neil and Willy), this reworks the existing API for tracking writeback errors into wrappers around the new API. That will greatly reduce the amount of code we'll need to change in filesystem specific drivers if it turns out to be an acceptable approach. If that does seem reasonable, then we can probably get rid of the new API and just drop it in as replacements for the old one. Despite the small diffstat here this is a fairly major change to how writeback errors are handled, and will need careful review and testing. This works as expected with some really basic by-hand testing, and it of course works when there are no errors in play. Once the patchset is a bit more settled, I do still plan to roll some xfstests to validate that this works and keeps working as expected. Comments and feedback are welcome here. Jeff Layton (17): mm: drop "wait" parameter from write_one_page mm: fix mapping_set_error call in me_pagecache_dirty buffer: use mapping_set_error instead of setting the flag ext2: don't test/clear AS_EIO flag orangefs: don't call filemap_write_and_wait from fsync mm: doc comment for scary spot in write_one_page fs: new infrastructure for writeback error handling and reporting fs: retrofit old error reporting API onto new infrastructure mm: remove AS_EIO and AS_ENOSPC flags dax: set errors in mapping when writeback fails nilfs2: set the mapping error when calling SetPageError on writeback mm: ensure that we set mapping error if writeout() fails mm: don't TestClearPageError in __filemap_fdatawait_range 9p: set mapping error when writeback fails in launder_page fuse: set mapping error in writepage_locked when it fails cifs: set mapping error when page writeback fails in writepage or launder_pages cifs: remove some unneeded mapping_set_error calls Documentation/filesystems/vfs.txt | 13 +- fs/9p/vfs_addr.c | 5 +- fs/btrfs/file.c | 10 +- fs/btrfs/tree-log.c | 9 +- fs/buffer.c | 2 +- fs/cifs/cifsfs.c | 4 +- fs/cifs/file.c | 14 +-- fs/cifs/inode.c | 6 +- fs/dax.c | 4 +- fs/exofs/dir.c | 2 +- fs/ext2/dir.c | 2 +- fs/ext2/file.c | 8 +- fs/f2fs/file.c | 3 + fs/f2fs/node.c | 6 +- fs/fuse/file.c | 8 +- fs/jfs/jfs_metapage.c | 4 +- fs/minix/dir.c | 2 +- fs/nilfs2/segment.c | 1 + fs/open.c | 3 + fs/orangefs/file.c | 5 +- fs/sync.c | 5 +- fs/sysv/dir.c | 2 +- fs/ufs/dir.c | 2 +- include/linux/fs.h | 24 +++- include/linux/mm.h | 2 +- include/linux/pagemap.h | 17 +-- ipc/shm.c | 5 +- mm/filemap.c | 258 ++++++++++++++++++++++++++++++++------ mm/memory-failure.c | 2 +- mm/migrate.c | 6 +- mm/page-writeback.c | 20 +-- 31 files changed, 341 insertions(+), 113 deletions(-) -- 2.9.3