Skip to content

Commit 5aa21b0

Browse files
Christoph Hellwigaxboe
authored andcommitted
loop: don't clear LO_FLAGS_PARTSCAN on LOOP_SET_STATUS{,64}
LOOP_SET_STATUS{,64} can set a lot more flags than it is supposed to clear (the LOOP_SET_STATUS_CLEARABLE_FLAGS vs LOOP_SET_STATUS_SETTABLE_FLAGS defines should have been a hint..). Fix this by only clearing the bits in LOOP_SET_STATUS_CLEARABLE_FLAGS. Fixes: ae074d0 ("loop: move updating lo_flag s out of loop_set_status_from_info") Reported-by: kernel test robot <oliver.sang@intel.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20250127143045.538279-1-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent e9d8c87 commit 5aa21b0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/block/loop.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,8 +1281,7 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info)
12811281
partscan = !(lo->lo_flags & LO_FLAGS_PARTSCAN) &&
12821282
(info->lo_flags & LO_FLAGS_PARTSCAN);
12831283

1284-
lo->lo_flags &= ~(LOOP_SET_STATUS_SETTABLE_FLAGS |
1285-
LOOP_SET_STATUS_CLEARABLE_FLAGS);
1284+
lo->lo_flags &= ~LOOP_SET_STATUS_CLEARABLE_FLAGS;
12861285
lo->lo_flags |= (info->lo_flags & LOOP_SET_STATUS_SETTABLE_FLAGS);
12871286

12881287
if (size_changed) {

0 commit comments

Comments
 (0)