On Fri, Nov 06, 2026 at 03:24:44PM +0000, Alex Brett wrote:
> When creating a new file, open_file() returns it with the offset after
> the header it has just written, but on opening an existing file it will
> return it with the offset at 0.
> 
> _read_bindings_file() reads sequentially from the returned fd, so on a
> newly created bindings file the header check in _check_bindings_file()
> hits EOF and declares the file bad. Without -B this is masked by
> rewriting the file, but "multipath -B" may not write it and aborts:
> 
>   ERROR: bad settings in read-only bindings file /etc/multipath/bindings
>   fatal configuration error, aborting
> 
> This affects the first "multipath -B" on any system without a bindings
> file, such as an installer environment.
> 
> The wwids and prkeys code paths seek before every access and are
> unaffected.
> 
> Fixes: 7eaeb33ae9f7 ("multipathd: watch bindings file with inotify + 
> timestamp")
> Signed-off-by: Alex Brett <[email protected]>
> Assisted-by: Claude:claude-opus-5-5

Reviewed-by: Benjamin Marzinski <[email protected]>


Reply via email to