]> git.baikalelectronics.ru Git - kernel.git/commit
zonefs: Do not propagate iomap_dio_rw() ENOTBLK error to user space
authorDamien Le Moal <damien.lemoal@opensource.wdc.com>
Thu, 30 Mar 2023 00:47:58 +0000 (09:47 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Apr 2023 10:10:51 +0000 (12:10 +0200)
commit4773b8aeac663666d008172d8630587bc1cbe1aa
tree1211f4ed4151e87bfb0520cd0f28f18e05e8c196
parent44902ec6e09a043f4307b72478670a08394c74d4
zonefs: Do not propagate iomap_dio_rw() ENOTBLK error to user space

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@infradead.org>
Fixes: 1ec48a99df3c ("fs: New zonefs file system")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Tested-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/zonefs/file.c