summaryrefslogtreecommitdiffstats
path: root/fs/partitions
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-27 10:24:40 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-27 10:24:40 -0700
commitbdf7cf1c83872a0586ce4c4da6889103cc36dbd3 (patch)
tree9311bbcf8b9ffbe7207eba5cca557275f8151ae7 /fs/partitions
parent40efeb4d0bb1993c3c10baff9b7d86839f99171e (diff)
parentac04fee0b5c55bbac0858727a4154110b55d3f5a (diff)
downloadop-kernel-dev-bdf7cf1c83872a0586ce4c4da6889103cc36dbd3.zip
op-kernel-dev-bdf7cf1c83872a0586ce4c4da6889103cc36dbd3.tar.gz
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block: loop: export module parameters block: export blk_{get,put}_queue() block: remove unused variable in bio_attempt_front_merge() block: always allocate genhd->ev if check_events is implemented brd: export module parameters brd: fix comment on initial device creation brd: handle on-demand devices correctly brd: limit 'max_part' module param to DISK_MAX_PARTS brd: get rid of unused members from struct brd_device block: fix oops on !disk->queue and sysfs discard alignment display
Diffstat (limited to 'fs/partitions')
-rw-r--r--fs/partitions/check.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 8ed4d343..f82e762 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -256,10 +256,12 @@ ssize_t part_discard_alignment_show(struct device *dev,
{
struct hd_struct *p = dev_to_part(dev);
struct gendisk *disk = dev_to_disk(dev);
+ unsigned int alignment = 0;
- return sprintf(buf, "%u\n",
- queue_limit_discard_alignment(&disk->queue->limits,
- p->start_sect));
+ if (disk->queue)
+ alignment = queue_limit_discard_alignment(&disk->queue->limits,
+ p->start_sect);
+ return sprintf(buf, "%u\n", alignment);
}
ssize_t part_stat_show(struct device *dev,
OpenPOWER on IntegriCloud