Bug 102921 - [btrfs-progs] inconsistency on "SSD detection" by mkfs.btrfs
Summary: [btrfs-progs] inconsistency on "SSD detection" by mkfs.btrfs
Status: RESOLVED INVALID
Alias: None
Product: File System
Classification: Unclassified
Component: btrfs (show other bugs)
Hardware: All Linux
: P1 low
Assignee: David Sterba
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-15 08:39 UTC by Tom Yan
Modified: 2015-10-30 23:33 UTC (History)
1 user (show)

See Also:
Kernel Version: 4.1.4
Tree: Mainline
Regression: No


Attachments
Test case on a partitionless drive (1.02 KB, text/plain)
2015-08-15 08:40 UTC, Tom Yan
Details
Test case on a partition (1.13 KB, text/plain)
2015-08-15 08:40 UTC, Tom Yan
Details

Description Tom Yan 2015-08-15 08:39:30 UTC
Apparently mkfs.btrfs detects whether a drive is an SSD by reading /sys/block/sdX/queue/rotational, so that it can determine whether to turn off metadata duplication. However, it seems that the detection fails if mkfs.btrfs is run on a partitionless drive.

See the difference between the two attached test cases. As you can see, the inconsistency only occurs with mkfs.btrfs. The "ssd" mount option will be used automatically for both cases.
Comment 1 Tom Yan 2015-08-15 08:40:00 UTC
Created attachment 184981 [details]
Test case on a partitionless drive
Comment 2 Tom Yan 2015-08-15 08:40:14 UTC
Created attachment 184991 [details]
Test case on a partition
Comment 3 David Sterba 2015-08-24 16:39:52 UTC
Oh right, that's a bug. Mounting will turn on the ssd optimizations, but the problem with mkfs affects the filesystem structures (DUP vs single)

Note You need to log in before you can comment on or make changes to this bug.