Thread (22 messages) 22 messages, 5 authors, 2017-04-25

Re: [PATCH 5/8] nowait aio: return on congested block device

From: Jan Kara <jack@suse.cz>
Date: 2017-04-20 14:47:50
Also in: linux-block, linux-btrfs, linux-ext4, linux-fsdevel, linux-xfs

On Wed 19-04-17 10:21:39, Goldwyn Rodrigues wrote:

On 04/19/2017 01:45 AM, Christoph Hellwig wrote:
quoted
quoted
+	if (bio->bi_opf & REQ_NOWAIT) {
+		if (!blk_queue_nowait(q)) {
+			err = -EOPNOTSUPP;
+			goto end_io;
+		}
+		if (!(bio->bi_opf & REQ_SYNC)) {
I don't understand this check at all..
It is to ensure at the block layer that NOWAIT comes only for DIRECT
calls only. I should probably change it to REQ_SYNC | REQ_IDLE.
Ouch. Checking 'REQ_SYNC' for this is

a) unreliable hack
b) layering violation

You just don't care why someone marked bio with REQ_NOWAIT at this place.
Just obey the request if you can, return error if you cannot, but advisory
REQ_SYNC or REQ_IDLE flags have nothing to do with the ability of the block
layer to submit the bio without blocking...

								Honza
-- 
Jan Kara [off-list ref]
SUSE Labs, CR
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help