This is a note to let you know that I've just added the patch titled zonefs: Do not propagate iomap_dio_rw() ENOTBLK error to user space to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: zonefs-do-not-propagate-iomap_dio_rw-enotblk-error-to-user-space.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 77af13ba3c7f91d91c377c7e2d122849bbc17128 Mon Sep 17 00:00:00 2001 From: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx> Date: Thu, 30 Mar 2023 09:47:58 +0900 Subject: zonefs: Do not propagate iomap_dio_rw() ENOTBLK error to user space From: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx> commit 77af13ba3c7f91d91c377c7e2d122849bbc17128 upstream. The call to invalidate_inode_pages2_range() in __iomap_dio_rw() may fail, in which case -ENOTBLK is returned and this error code is propagated back to user space trhough iomap_dio_rw() -> zonefs_file_dio_write() return chain. This error code is fairly obscure and may confuse the user. Avoid this and be consistent with the behavior of zonefs_file_dio_append() for similar invalidate_inode_pages2_range() errors by returning -EBUSY to user space when iomap_dio_rw() returns -ENOTBLK. Suggested-by: Christoph Hellwig <hch@xxxxxxxxxxxxx> Fixes: 8dcc1a9d90c1 ("fs: New zonefs file system") Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx> Reviewed-by: Christoph Hellwig <hch@xxxxxx> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@xxxxxxx> Tested-by: Hans Holmberg <hans.holmberg@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/zonefs/file.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) --- a/fs/zonefs/file.c +++ b/fs/zonefs/file.c @@ -567,11 +567,21 @@ static ssize_t zonefs_file_dio_write(str append = sync; } - if (append) + if (append) { ret = zonefs_file_dio_append(iocb, from); - else + } else { + /* + * iomap_dio_rw() may return ENOTBLK if there was an issue with + * page invalidation. Overwrite that error code with EBUSY to + * be consistent with zonefs_file_dio_append() return value for + * similar issues. + */ ret = iomap_dio_rw(iocb, from, &zonefs_write_iomap_ops, &zonefs_write_dio_ops, 0, NULL, 0); + if (ret == -ENOTBLK) + ret = -EBUSY; + } + if (zonefs_zone_is_seq(z) && (ret > 0 || ret == -EIOCBQUEUED)) { if (ret > 0) Patches currently in stable-queue which might be from damien.lemoal@xxxxxxxxxxxxxxxxxx are queue-6.1/zonefs-separate-zone-information-from-inode-informat.patch queue-6.1/zonefs-reorganize-code.patch queue-6.1/zonefs-do-not-propagate-iomap_dio_rw-enotblk-error-to-user-space.patch queue-6.1/zonefs-fix-error-message-in-zonefs_file_dio_append.patch queue-6.1/zonefs-simplify-io-error-handling.patch queue-6.1/zonefs-reduce-struct-zonefs_inode_info-size.patch