Re: [PATCH] file-posix: Fix crash on discard_granularity == 0

2025-04-30 Thread Kevin Wolf
Am 29.04.2025 um 23:09 hat Eric Blake geschrieben: > On Tue, Apr 29, 2025 at 05:56:54PM +0200, Kevin Wolf wrote: > > Block devices that don't support discard have a discard_granularity of > > 0. Currently, this results in a division by zero when we try to make > > sure that it's a multiple of reque

Re: [PATCH] file-posix: Fix crash on discard_granularity == 0

2025-04-30 Thread Stefan Hajnoczi
On Tue, Apr 29, 2025 at 05:56:54PM +0200, Kevin Wolf wrote: > Block devices that don't support discard have a discard_granularity of > 0. Currently, this results in a division by zero when we try to make > sure that it's a multiple of request_alignment. Only try to update > bs->bl.pdiscard_alignmen

Re: [PATCH] file-posix: Fix crash on discard_granularity == 0

2025-04-30 Thread Stefan Hajnoczi
On Tue, Apr 29, 2025 at 05:56:54PM +0200, Kevin Wolf wrote: > Block devices that don't support discard have a discard_granularity of > 0. Currently, this results in a division by zero when we try to make > sure that it's a multiple of request_alignment. Only try to update > bs->bl.pdiscard_alignmen

Re: [PATCH] file-posix: Fix crash on discard_granularity == 0

2025-04-29 Thread Eric Blake
On Tue, Apr 29, 2025 at 05:56:54PM +0200, Kevin Wolf wrote: > Block devices that don't support discard have a discard_granularity of > 0. Currently, this results in a division by zero when we try to make > sure that it's a multiple of request_alignment. Only try to update > bs->bl.pdiscard_alignmen

[PATCH] file-posix: Fix crash on discard_granularity == 0

2025-04-29 Thread Kevin Wolf
Block devices that don't support discard have a discard_granularity of 0. Currently, this results in a division by zero when we try to make sure that it's a multiple of request_alignment. Only try to update bs->bl.pdiscard_alignment when we got a non-zero discard_granularity from sysfs. Fixes: f60