@@ -1433,7 +1433,9 @@ static ssize_t btrfs_read_policy_store(struct kobject *kobj,
#ifdef CONFIG_BTRFS_EXPERIMENTAL
if (index == BTRFS_READ_POLICY_RR) {
if (value != -1) {
- if ((value % fs_devices->fs_info->sectorsize) != 0) {
+ u32 rem;
+ div_u64_rem(value, fs_devices->fs_info->sectorsize, &rem);
The original check is already bad, it's just a IS_ALIGNED().
So a much simpler solution is:
+ if (!IS_ALIGNED(value, fs_info->sectorsize)) {