The -EIO returned here can end up overriding whatever error is marked in
the address space, and be returned at fsync time, even when there is a
more appropriate error stored in the mapping.
Read errors are also sometimes tracked on a per-page level using
PG_error. Suppose we have a read error on a
filemap_write_and_wait{_range} will return an error if writeback
initiation fails, but won't clear errors in the address_space. This is
particularly problematic on DAX, as it's effectively synchronous. Ensure
that we clear the AS_EIO/AS_ENOSPC flags when filemap_fdatawrite returns
an error.
Signed
Most filesystems currently use mapping_set_error and
filemap_check_errors for setting and reporting/clearing writeback errors
at the mapping level. filemap_check_errors is indirectly called from
most of the filemap_fdatawait_* functions and from
filemap_write_and_wait*. These functions are called f
When a writeback error occurs, we want later callers to be able to pick
up that fact when they go to wait on that writeback to complete.
Traditionally, we've used AS_EIO/AS_ENOSPC flags to track that, but
that's problematic since only one "checker" will be informed when an
error occurs.
In later p
Just check and advance the errseq_t in the file before returning.
Internal callers of filemap_* functions are left as-is.
Signed-off-by: Jeff Layton
---
fs/btrfs/file.c | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 0f102a1b851f
For btrfs, we can test how it reports data writeback errors on fsync by
implementing a suggestion from Chris Mason:
Build a filesystem with 2 devices that stripes the data across
both devices, but mirrors metadata across both. Then, make one
of the devices fail and test what it does.
Cc: Chris Ma
Ensure that we get an error back on all fds when a block device is
open by multiple writers and writeback fails.
Signed-off-by: Jeff Layton
---
tests/generic/998 | 63 +++
tests/generic/998.out | 2 ++
tests/generic/group | 1 +
3 files cha
Let's try to make this extra clear for fs authors.
Cc: Jan Kara
Signed-off-by: Jeff Layton
---
Documentation/filesystems/vfs.txt | 43 ---
1 file changed, 40 insertions(+), 3 deletions(-)
diff --git a/Documentation/filesystems/vfs.txt
b/Documentation/filesy
This is a very minimal conversion to errseq_t based error tracking
for raw block device access.
Only real change that is strictly required is that we must
unconditionally call filemap_report_wb_err in blkdev_fsync.
That ensures that the file's errseq_t is always advanced to
the latest value in the
ext4 uses the blockdev mapping for tracking metadata stored in the
pagecache. Sample its wb_err when opening a file and store that in
the f_md_wb_err field.
Change ext4_sync_file to check for data errors first, and then check the
blockdev mapping for metadata errors afterward.
Note that because m
To enable that, make __errseq_set return the value that it was set to
when we exit the loop. Take heed that that value is not suitable as a
later "since" value, as it will not have been marked seen.
Signed-off-by: Jeff Layton
---
include/linux/errseq.h | 2 +-
include/linux/fs.h
Signed-off-by: Jeff Layton
---
common/rc | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/common/rc b/common/rc
index 57001b47a8b7..43e160e91360 100644
--- a/common/rc
+++ b/common/rc
@@ -840,7 +840,16 @@ _scratch_mkfs()
mkfs_cmd="$MKFS_BTRFS_PROG"
The main changes in this set from the last are:
- add a btrfs/999.out file
- use _supported_fs to whitelist fs' on which the tests should run
- fix the ext3/4 mount option handling when creating journal device
- ensure that dmerror is installed on make install
These tests are intended to test the
I'm working on a set of kernel patches to change how writeback errors
are handled and reported in the kernel. Instead of reporting a
writeback error to only the first fsync caller on the file, it has
the the kernel report them once on every file description that was
open at the time of the error.
Set the flag to indicate that we want new-style data writeback error
handling.
This means that we need to override the open routines for files and
directories so that we can sample the bdev wb_err at open.
Signed-off-by: Jeff Layton
---
fs/ext2/dir.c | 8
fs/ext2/file.c | 26
Jan Kara's description for this patch is much better than mine, so I'm
quoting it verbatim here:
DAX currently doesn't set errors in the mapping when cache flushing
fails in dax_writeback_mapping_range(). Since this function can get
called only from fsync(2) or sync(2), this is actually as good as
Just check and advance the data errseq_t in struct file before
before returning from fsync on normal files. Internal filemap_*
callers are left as-is.
Signed-off-by: Jeff Layton
---
fs/xfs/xfs_file.c | 15 +++
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/fs/xfs/xfs_
Some filesystems keep a different mapping for metadata writeback. Add a
second errseq_t to struct file for tracking metadata writeback errors.
Also add a new function for checking a mapping of the caller's choosing
vs. the f_md_wb_err value.
Signed-off-by: Jeff Layton
---
include/linux/fs.h
The writeback error handling test requires that you put the journal on a
separate device. This allows us to use dmerror to simulate data
writeback failure, without affecting the journal.
xfs already has infrastructure for this (a'la $SCRATCH_LOGDEV), so wire
up the ext4 code so that it can do the
Add a call to filemap_report_wb_err at the end of ext4_sync_file. This
will ensure that we check and advance the errseq_t in the file, which
allows us to track and report errors on all open fds when they occur.
Note that metadata writeback errors are not yet reported on all fds at
this point. That
An errseq_t is a way of recording errors in one place, and allowing any
number of "subscribers" to tell whether an error has been set again
since a previous time.
It's implemented as an unsigned 32-bit value that is managed with atomic
operations. The low order bits are designated to hold an error
Don't try to check PageError since that's potentially racy and not
necessarily going to be set after writepage errors out.
Instead, check the mapping for an error after writepage returns.
Signed-off-by: Jeff Layton
Reviewed-by: Jan Kara
---
mm/page-writeback.c | 15 +++
1 file chan
If there were previously both metadata and data writeback errors when
fsync is called, then it will currently take two calls to fsync() to
clear them on some filesystems.
The problem is in __generic_file_fsync, which won't try to write back
the metadata if the data flush fails. Fix this by always
Resetting this flag is almost certainly racy, and will be problematic
with some coming changes.
Make filemap_fdatawait_keep_errors return int, but not clear the flag(s).
Have jbd2 call it instead of filemap_fdatawait and don't attempt to
re-set the error flag if it fails.
Signed-off-by: Jeff Layt
I noticed on xfs that I could still sometimes get back an error on fsync
on a fd that was opened after the error condition had been cleared.
The problem is that the buffer code sets the write_io_error flag and
then later checks that flag to set the error in the mapping. That flag
perisists for qui
ext2 currently does a test+clear of the AS_EIO flag, which is
is problematic for some coming changes.
What we really need to do instead is call filemap_check_errors
in __generic_file_fsync after syncing out the buffers. That
will be sufficient for this case, and help other callers detect
these err
v7:
===
This is the seventh posting of the patchset to revamp the way writeback
errors are tracked and reported.
The main difference from the v6 posting is the removal of the
FS_WB_ERRSEQ flag. That requires a few other incremental patches in the
writeback code to ensure that both error tracking m
Signed-off-by: Jeff Layton
Reviewed-by: Jan Kara
Reviewed-by: Matthew Wilcox
Reviewed-by: Christoph Hellwig
---
fs/buffer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/buffer.c b/fs/buffer.c
index 44172d11efae..7b4f4bfde91e 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
Requested-by: Christoph Hellwig
Signed-off-by: Jeff Layton
---
fs/sync.c | 2 +-
include/linux/fs.h | 6 --
ipc/shm.c | 2 +-
3 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/fs/sync.c b/fs/sync.c
index 11ba023434b1..2a54c1f22035 100644
--- a/fs/sync.c
+++ b/f
Sorry for above post, the error is just because of passing the parent
and current snapshots from different physical disks.
2017-06-16 9:29 GMT+03:00 Cerem Cem ASLAN :
> Hello everybody,
>
> I'm facing with a "No such file or directory" issue which only occurs
> if I use a `btrfs send -p myparent
For devices that support flushing, we allocate a bio, submit, wait for
it and then free it. The bio allocation does not fail so ENOMEM is not a
problem but we still may unnecessarily stress the allocation subsystem.
Instead, we can allocate the bio at the same time we allocate the device
and reuse
We should really just wait in wait_dev_flush and let the caller decide
what to do with the error value.
Signed-off-by: David Sterba
---
fs/btrfs/disk-io.c | 11 +++
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 85f931c5e63c..5
Similar to what submit_bio_wait does, we should account for IO while
waiting for a bio completion. This has marginal visible effects, flush
bio is short-lived.
Reviewed-by: Anand Jain
Signed-off-by: David Sterba
---
fs/btrfs/disk-io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
This patchset follows the updates in the write_dev_flush function. The flush
bio can be preallocated at the device creation time, so we avoid repeated
alloc/free.
v2:
- merge 'flush_bio_sent' from 4 to 1 and dropped patch 4
- dropped sysfs tunable (patch 5)
- fix typo in patch 1 changelog
David S
On Fri, Jun 16, 2017 at 06:27:20AM +0800, Anand Jain wrote:
>
>
>
>
> >> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> >> index 59a732a13370..659a3b4645d2 100644
> >> --- a/fs/btrfs/disk-io.c
> >> +++ b/fs/btrfs/disk-io.c
> >> @@ -3494,7 +3494,8 @@ static void write_dev_flush(struct bt
On Fri, Jun 16, 2017 at 05:53:12AM +0800, Anand Jain wrote:
> On 06/16/2017 12:49 AM, David Sterba wrote:
> > For devices that support flushing, we allocate a bio, submit, wait for
> > it and then free it. The bio allocation does not fail so ENOMEM is not a
> > problem but we still may unnecessaril
On Fri, Apr 07, 2017 at 10:43:15AM +0800, Qu Wenruo wrote:
> fs/btrfs/extent_io.c | 124
> ++-
> 1 file changed, 122 insertions(+), 2 deletions(-)
I see a lot of warnings from btrfs/094
[13458.628334] BTRFS warning (device sdb6): unhandled fiemap
We got an internal report about a file system not wanting to mount
following 99e3ecfcb9f4 ("Btrfs: add more validation checks for superblock").
BTRFS error (device sdb1): super_total_bytes 1000203816960 mismatch with
fs_devices total_rw_bytes 1000203820544
Substracting the numbers we get a differ
Hello,
Here is a small series which fixes an issue that got reported internally to
Suse and which affects devices whose size is not multiple of sectorsize. More
information can be found in the changelog for patch 2
The first patch in the series re-implements the btrfs_device_total_bytes
getter/
The device->total_bytes member needs to always be rounded down to sectorsize
so that it corresponds to the value of super->total_bytes. However, there are
multiple places where the setter is fed a value which is not rounded which
can cause a fs to be unmountable due to the check introduced in
99e3e
2017-06-15 12:44 GMT+03:00 Vianney Stroebel :
> On a backup drive for a home computer, disk usage as shown by 'btrfs fi
> show' is more than double the snapshots exclusive data as shown by "btrfs
> qgroup show" (574 GB vs 265 GB).
>
> I've done a lot of research online and I couldn't find any answe
On 06/15, Nikolay Borisov wrote:
>
>
>On 15.06.2017 04:17, kbuild test robot wrote:
>> Hi Nikolay,
>>
>> [auto build test ERROR on v4.9-rc8]
>> [cannot apply to btrfs/next kdave/for-next next-20170614]
>> [if your patch is applied to the wrong git tree, please drop us a note to
>> help improve th
42 matches
Mail list logo