All of lore.kernel.org
 help / color / mirror / Atom feed
* REQ_OP_WRITE_ZEROES clash with REQ_FAILFAST_TRANSPORT ?
@ 2018-09-21  9:15 Hannes Reinecke
  2018-09-21 10:11 ` Hannes Reinecke
  0 siblings, 1 reply; 2+ messages in thread
From: Hannes Reinecke @ 2018-09-21  9:15 UTC (permalink / raw)
  To: Jens Axboe, Christoph Hellwig, linux-block

Hi all,

there's one thing which decidedly puzzles me:

We have:

#define REQ_OP_BITS	8
#define REQ_OP_MASK	((1 << REQ_OP_BITS) - 1)
#define REQ_FLAG_BITS	24

enum req_opf {
	/* read sectors from the device */
	REQ_OP_READ		= 0,
	/* write sectors to the device */
	REQ_OP_WRITE		= 1,
	/* flush the volatile write cache */
	REQ_OP_FLUSH		= 2,
	/* discard sectors */
	REQ_OP_DISCARD		= 3,
	/* get zone information */
	REQ_OP_ZONE_REPORT	= 4,
	/* securely erase sectors */
	REQ_OP_SECURE_ERASE	= 5,
	/* seset a zone write pointer */
	REQ_OP_ZONE_RESET	= 6,
	/* write the same sector many times */
	REQ_OP_WRITE_SAME	= 7,
	/* write the zero filled sector many times */
 >>	REQ_OP_WRITE_ZEROES	= 9,

and

enum req_flag_bits {
	__REQ_FAILFAST_DEV =	/* no driver retries of device errors */
		REQ_OP_BITS,
 >>	__REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */
	__REQ_FAILFAST_DRIVER,	/* no driver retries of driver errors */

If my calculation skills are correct, both __REQ_FAILFAST_TRANSPORT and 
REQ_OP_WRITE_ZEROES end up on bit 9.

Which means that
a) any check for REQ_OP_WRITE_ZEROES will be true for a request with 
REQ_FAILFAST_TRANSPORT
and
b) this check:
#define req_op(req) \
	((req)->cmd_flags & REQ_OP_MASK)

will actually _exclude_ REQ_WRITE_ZEROES.
Am I correct?
Is this intended?

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: REQ_OP_WRITE_ZEROES clash with REQ_FAILFAST_TRANSPORT ?
  2018-09-21  9:15 REQ_OP_WRITE_ZEROES clash with REQ_FAILFAST_TRANSPORT ? Hannes Reinecke
@ 2018-09-21 10:11 ` Hannes Reinecke
  0 siblings, 0 replies; 2+ messages in thread
From: Hannes Reinecke @ 2018-09-21 10:11 UTC (permalink / raw)
  To: Jens Axboe, Christoph Hellwig, linux-block

On 9/21/18 11:15 AM, Hannes Reinecke wrote:
> Hi all,
> 
> there's one thing which decidedly puzzles me:
> 
[ .. ]

Ah. Screw that.
REQ_OP_XXX is a number, and the others are a bitmask.

Sorry for the noise.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-21 10:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-21  9:15 REQ_OP_WRITE_ZEROES clash with REQ_FAILFAST_TRANSPORT ? Hannes Reinecke
2018-09-21 10:11 ` Hannes Reinecke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.