Bug 46981
Summary: | [PATCH]/sys/class/*/queue/read_ahead_kb stores unexpected values written by writev | ||
---|---|---|---|
Product: | File System | Reporter: | Dave Reisner (d) |
Component: | SysFS | Assignee: | Greg Kroah-Hartman (greg) |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | alan, florian |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 3.5.3 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
test program to show behavior
return and check errors from queue_var_store |
Description
Dave Reisner
2012-09-03 20:01:10 UTC
Created attachment 79161 [details]
test program to show behavior
As I suspected, this is being treated as 2 separate writes. I added a printk to the queue_var_store function in block/blk-sysfs.c, and dmesg now shows the below when I call the equivalent of "./writev /sys/class/block/sda/queue/read_ahead_kb 1024". [ 0.892319] queue_var_store: 1024 [ 0.892704] queue_var_store: 0 And the root of the issue doesn't seem to be the two writes, but the fact that queue_var_store does not seem to not reject invalid values, and the callers of this function never expect it to fail. I would have expected that writing a letter to queue/read_ahead_kb would just return EINVAL, but it instead stores a 0 in the node. I'm attaching a diff against linus's tree which illustrates this and fixes the immediate issue, but I don't expect this to be a proper/complete fix. Created attachment 79171 [details]
return and check errors from queue_var_store
Please send patches, with a Signed-off-by: line to linux-kernel@vger.kernel.org, we can't accept them without the Signed-off-by: line. thanks Closing as I don't take patches from bugzilla This should have been closed as fixed -- my change was merged via LKML by Jens Axboe: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b1f3b64d76cf88cc A patch referencing this bug report has been merged in Linux v3.7-rc1: commit b1f3b64d76cf88cc250e5cdd1de783ba9737078e Author: Dave Reisner <dreisner@archlinux.org> Date: Sat Sep 8 11:55:45 2012 -0400 block: reject invalid queue attribute values |