Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compat: fix compat for bdev_nr_sectors
Fixup for commit ba8c076 ("compat: test and compat patch for bdev_nr_sectors"). This was broken on all platforms that used the compat implementation (i.e. all kernels <5.10, which is most of the kernels we build for). get_capacity actually returns the size of part0, which is why this is fine for non-partioned backing devices (the size of part0 is equivalent to the size of the whole device then). If the backing device is a partition, however, it will read the wrong size and detach the DRBD device. So just fall back to the slightly uglier open-coded version in the compat implementation.
- Loading branch information