* PATCH for a little bug in deadline-iosched.c
@ 2004-12-28 15:56 Juergen Quade
0 siblings, 0 replies; only message in thread
From: Juergen Quade @ 2004-12-28 15:56 UTC (permalink / raw)
To: torvalds, axboe; +Cc: linux-kernel
There is some (obvious) mess with "unsigned int" and "int" in
the deadline-io-scheduler (sysfs-section). Try to change
the attribute "writes_starved":
root@ezs-mobil:/sys/block/hda/queue# cat scheduler
noop anticipatory [deadline]
root@ezs-mobil:/sys/block/hda/queue# cd iosched/
root@ezs-mobil:/sys/block/hda/queue/iosched# ls
fifo_batch front_merges read_expire write_expire writes_starved
root@ezs-mobil:/sys/block/hda/queue/iosched# cat writes_starved
2
root@ezs-mobil:/sys/block/hda/queue/iosched# echo 4 >writes_starved
root@ezs-mobil:/sys/block/hda/queue/iosched# cat writes_starved
-2147483648
root@ezs-mobil:/sys/block/hda/queue/iosched#
Because all attribute-variables are defined as "int", the patch
below changes them to "int". Now it works as expected...
Juergen.
P.S.: Does it really make sense to allow a negative "writes_starved"?
==========================================================================
Signed-off-by: Juergen Quade <quade@hsnr.de>
--- linux-2.6.10/drivers/block/deadline-iosched.c.org 2004-12-28 16:19:46.000000000 +0100
+++ linux-2.6.10/drivers/block/deadline-iosched.c 2004-12-28 16:36:59.000000000 +0100
@@ -791,24 +791,24 @@
};
static ssize_t
-deadline_var_show(unsigned int var, char *page)
+deadline_var_show(int var, char *page)
{
return sprintf(page, "%d\n", var);
}
static ssize_t
-deadline_var_store(unsigned int *var, const char *page, size_t count)
+deadline_var_store(int *var, const char *page, size_t count)
{
char *p = (char *) page;
- *var = simple_strtoul(p, &p, 10);
+ *var = (int)simple_strtol(p, &p, 10);
return count;
}
#define SHOW_FUNCTION(__FUNC, __VAR, __CONV) \
static ssize_t __FUNC(struct deadline_data *dd, char *page) \
{ \
- unsigned int __data = __VAR; \
+ int __data = __VAR; \
if (__CONV) \
__data = jiffies_to_msecs(__data); \
return deadline_var_show(__data, (page)); \
@@ -823,7 +823,7 @@
#define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX, __CONV) \
static ssize_t __FUNC(struct deadline_data *dd, const char *page, size_t count) \
{ \
- unsigned int __data; \
+ int __data; \
int ret = deadline_var_store(&__data, (page), count); \
if (__data < (MIN)) \
__data = (MIN); \
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-12-28 15:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-28 15:56 PATCH for a little bug in deadline-iosched.c Juergen Quade
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).