[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170509154930.29524-27-jlayton@redhat.com>
Date: Tue, 9 May 2017 11:49:29 -0400
From: Jeff Layton <jlayton@...hat.com>
To: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-btrfs@...r.kernel.org, linux-ext4@...r.kernel.org,
linux-cifs@...r.kernel.org, linux-nfs@...r.kernel.org,
linux-mm@...ck.org, jfs-discussion@...ts.sourceforge.net,
linux-xfs@...r.kernel.org, cluster-devel@...hat.com,
linux-f2fs-devel@...ts.sourceforge.net,
v9fs-developer@...ts.sourceforge.net, linux-nilfs@...r.kernel.org,
linux-block@...r.kernel.org
Cc: dhowells@...hat.com, akpm@...ux-foundation.org, hch@...radead.org,
ross.zwisler@...ux.intel.com, mawilcox@...rosoft.com,
jack@...e.com, viro@...iv.linux.org.uk, corbet@....net,
neilb@...e.de, clm@...com, tytso@....edu, axboe@...nel.dk,
josef@...icpanda.com, hubcap@...ibond.com, rpeterso@...hat.com,
bo.li.liu@...cle.com
Subject: [PATCH v4 26/27] mm: flesh out comments over mapping_set_error
Signed-off-by: Jeff Layton <jlayton@...hat.com>
---
include/linux/pagemap.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 9593eac41499..9b453eae0aa1 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -27,6 +27,20 @@ enum mapping_flags {
AS_NO_WRITEBACK_TAGS = 3,
};
+/**
+ * mapping_set_error - record a writeback error in the address_space
+ * @mapping - the mapping in which an error should be set
+ * @error - the error to set in the mapping
+ *
+ * When writeback fails in some way, we must record that error so that
+ * userspace can be informed when fsync and the like are called. We endeavor
+ * to report errors on any file that was open at the time of the error. Some
+ * internal callers also need to know when writeback errors have occurred.
+ *
+ * When a writeback error occurs, most will filesystems will want to call
+ * mapping_set_error to record the error in the mapping so that it will be
+ * automatically reported whenever fsync is called on the file.
+ */
static inline void mapping_set_error(struct address_space *mapping, int error)
{
return errseq_set(&mapping->wb_err, error);
--
2.9.3
Powered by blists - more mailing lists