summaryrefslogtreecommitdiffstats
path: root/fs/partitions
diff options
context:
space:
mode:
authorShaohua Li <shaohua.li@intel.com>2011-03-22 08:35:35 +0100
committerJens Axboe <jaxboe@fusionio.com>2011-03-22 08:35:35 +0100
commit1e9bb8808ac11094d711d20d580e7b45a4992d0c (patch)
treed0e228b619664b7f507e37e5eba4a5ebeef103a0 /fs/partitions
parent5e84ea3a9c662dc2d7a48703a4468fad954a3b7f (diff)
downloadblackbird-obmc-linux-1e9bb8808ac11094d711d20d580e7b45a4992d0c.tar.gz
blackbird-obmc-linux-1e9bb8808ac11094d711d20d580e7b45a4992d0c.zip
block: fix non-atomic access to genhd inflight structures
After the stack plugging introduction, these are called lockless. Ensure that the counters are updated atomically. Signed-off-by: Shaohua Li<shaohua.li@intel.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'fs/partitions')
-rw-r--r--fs/partitions/check.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 9c21119512b9..ac546975031f 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -290,7 +290,8 @@ ssize_t part_inflight_show(struct device *dev,
{
struct hd_struct *p = dev_to_part(dev);
- return sprintf(buf, "%8u %8u\n", p->in_flight[0], p->in_flight[1]);
+ return sprintf(buf, "%8u %8u\n", atomic_read(&p->in_flight[0]),
+ atomic_read(&p->in_flight[1]));
}
#ifdef CONFIG_FAIL_MAKE_REQUEST
OpenPOWER on IntegriCloud