diff options
author | Kevin Wolf <kwolf@redhat.com> | 2021-12-09 16:22:31 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2022-01-14 12:03:16 +0100 |
commit | b9b8860d24676ec59c878d5206ea6bcfc87af798 (patch) | |
tree | d3b1718b95421bbb1eb333d26c00bb9ab66c54f1 /block/quorum.c | |
parent | 2db9b9e96f0b57ceaa49666d9b8a573290114fdf (diff) |
vvfat: Fix vvfat_write() for writes before the root directory
The calculation in sector2cluster() is done relative to the offset of
the root directory. Any writes to blocks before the start of the root
directory (in particular, writes to the FAT) result in negative values,
which are not handled correctly in vvfat_write().
This changes sector2cluster() to return a signed value, and makes sure
that vvfat_write() doesn't try to find mappings for negative cluster
number. It clarifies the code in vvfat_write() to make it more obvious
that the cluster numbers can be negative.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20211209152231.23756-1-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/quorum.c')
0 files changed, 0 insertions, 0 deletions