btrfs-progs: mkfs: increase buffer size in is_ssd
authorMichael Lass <bevan@bi-co.net>
Sun, 8 Nov 2015 15:33:03 +0000 (16:33 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 16 Nov 2015 13:23:44 +0000 (14:23 +0100)
commit28f9f620f3473389cdba80ae606bf064e5b16628
treeb2464640f9dfb60381ac9a9a91435eb36c5c071f
parent87ab14013a38a93930dd47a16eec68930ec8f320
btrfs-progs: mkfs: increase buffer size in is_ssd

In current versions of util-linux the buffer passed to blkid_devno_to_wholedisk
has to be sufficiently large to not only hold the device name but the complete
target of the /sys/dev/block/<maj:min> symlink. This was changed only recently
in 4419ffb9eff5801fdbd385a4a6199b3877f802ad.

The small buffer size currently can lead to failure of is_ssd due to truncated
device names:

readlink("/sys/dev/block/254:7", "../../devices/virtual/block/dm-", 31) = 31
open("/sys/block/dm-/queue/rotational", O_RDONLY) = -1 ENOENT (No such file or directory)

Signed-off-by: Michael Lass <bevan@bi-co.net>
Signed-off-by: David Sterba <dsterba@suse.com>
mkfs.c