Message ID | 20200605204838.10765-2-rgoldwyn@suse.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Transient errors in Direct I/O | expand |
On Fri, Jun 05, 2020 at 03:48:36PM -0500, Goldwyn Rodrigues wrote: > Return zero in case a page cache invalidation is unsuccessful so > filesystems can fallback to buffered I/O. I don't think it's acceptable to change common code to fix a btrfs bug at this point in the release cycle. This change needs to be agreed to before the -rc5 stage, not during the pre-rc1 window. If you can't fix this in btrfs alone, then back out the btrfs changes for now.
diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c index e4addfc58107..215315be6233 100644 --- a/fs/iomap/direct-io.c +++ b/fs/iomap/direct-io.c @@ -483,9 +483,15 @@ iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, */ ret = invalidate_inode_pages2_range(mapping, pos >> PAGE_SHIFT, end >> PAGE_SHIFT); - if (ret) - dio_warn_stale_pagecache(iocb->ki_filp); - ret = 0; + /* + * If a page can not be invalidated, return 0 to fall back + * to buffered write. + */ + if (ret) { + if (ret == -EBUSY) + ret = 0; + goto out_free_dio; + } if (iov_iter_rw(iter) == WRITE && !wait_for_completion && !inode->i_sb->s_dio_done_wq) {