From: Stefan Bader <Stefan.Bader@de.ibm.com>
To: dm-devel@redhat.com
Subject: [PATCH and question]: dm-table should check for valid queue
Date: Thu, 10 Aug 2006 13:29:08 +0200 [thread overview]
Message-ID: <44DB1884.7070800@de.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 631 bytes --]
Hi,
in some cases it is possible that bdev_get_queue() returns NULL. And
there are some places where device-mapper just uses the returned pointer
to call queue functions. The attached patch adds this to
dm_table_unplug_all() and dm_table_flush_all(). I treated a device
without a queue as sort of successfully flushed. Is this what would be
expected?
Same problem with dm_table_any_congested() which I didn't change, yet.
This function should probably also check before using
q->backing_dev_info. But what effect should a missing queue have? Same
as device is congested or not or let the call fail somehow?
Regards,
Stefan Bader
[-- Attachment #2: dm-table-checkreqq.diff --]
[-- Type: text/plain, Size: 692 bytes --]
diff -Nurp linux-RHEL4/drivers/md/dm-table.c linux-RHEL4-BTM/drivers/md/dm-table.c
--- linux-RHEL4/drivers/md/dm-table.c 2006-08-07 13:15:30.000000000 +0200
+++ linux-RHEL4-BTM/drivers/md/dm-table.c 2005-10-06 15:34:15.000000000 +0200
@@ -917,7 +917,7 @@ void dm_table_unplug_all(struct dm_table
struct dm_dev *dd = list_entry(d, struct dm_dev, list);
request_queue_t *q = bdev_get_queue(dd->bdev);
- if (q && q->unplug_fn)
+ if (q->unplug_fn)
q->unplug_fn(q);
}
}
@@ -932,9 +932,6 @@ int dm_table_flush_all(struct dm_table *
request_queue_t *q = bdev_get_queue(dd->bdev);
int err;
- if (!q)
- continue;
-
if (!q->issue_flush_fn)
err = -EOPNOTSUPP;
else
[-- Attachment #3: Type: text/plain, Size: 0 bytes --]
next reply other threads:[~2006-08-10 11:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-10 11:29 Stefan Bader [this message]
2006-08-14 18:12 ` [PATCH and question]: dm-table should check for valid queue Alasdair G Kergon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44DB1884.7070800@de.ibm.com \
--to=stefan.bader@de.ibm.com \
--cc=dm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.