Skip to contentSkip to conversation

Subject: [PATCH] bsg: Error print if device is not bidi capable when refusing a bidi command

PATCH Boaz Harrosh 1 participant 1 message Jan 20, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

If a bidi command was issued to a request_queue not mark as QUEUE_FLAG_BIDI. Issue an error report. This is a misconfiguration an administrator would like to know about, which is otherwise hard to detect.

---
 block/bsg.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
block/bsg.c +2 -0
index 44a2a0f..977547a 100644
@@ -270,6 +270,8 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm,
 
 	if (rw == WRITE && hdr->din_xfer_len) {
 		if (!test_bit(QUEUE_FLAG_BIDI, &q->queue_flags)) {
+			printk(KERN_ERR "bsg: Attempt to send a bidi command "
+			       "to a none bidi device\n");
 			ret = -EOPNOTSUPP;
 			goto out;
 		}
Signature · 1 line
1.6.0.1