summaryrefslogtreecommitdiffstats
path: root/fs/partitions
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-27 19:24:40 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-27 19:24:40 +0200
commitbdf7cf1c83872a0586ce4c4da6889103cc36dbd3 (patch)
tree9311bbcf8b9ffbe7207eba5cca557275f8151ae7 /fs/partitions
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6 (diff)
parentloop: export module parameters (diff)
downloadlinux-bdf7cf1c83872a0586ce4c4da6889103cc36dbd3.tar.xz
linux-bdf7cf1c83872a0586ce4c4da6889103cc36dbd3.zip
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 8ed4d3433199..f82e762eeca2 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,