question about mapping_set_error when writeback fails?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In iomap_finish_page_writeback,

static void
iomap_finish_page_writeback(struct inode *inode, struct page *page,
		int error, unsigned int len)
{
	struct iomap_page *iop = to_iomap_page(page);

	if (error) {
		SetPageError(page);
		mapping_set_error(inode->i_mapping, -EIO);

Why don't we pass error to mapping_set_error here?  If the writeback
completion failed due to insufficient space (e.g. extent mapping btree
expansion hit ENOSPC while trying to perform an unwritten extent
conversion) then we set AS_EIO which causes fsync to return EIO instead
of ENOSPC like you'd expect.

The line in question was lifted from XFS; is this a historical behavior
from before we had AS_ENOSPC?  Or do we always set AS_EIO because that's
the error code that everyone understands (ha) to mean that writeback
failed and now we have no idea what's on disk vs. in the pagecache?

(I tried to figure out what ext4 and btrfs do to handle this, but ...
that was a twisty code maze and I gave up.)

--D



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux