Possible to assign the unsigned nr_allocated_this_transaction a negative value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Joe,

In the commit be500ed721a6ec8d49bf0814c277ce7162acee0e, the interface of sm_disk_{inc, dec}_blocks() of dm-space-map
was redesigned. The modified version of sm_disk_dec_blocks() changes nr_allocated_this_transaction right after returning from
sm_ll_dec(), without checking on whether the released blocks were also free in the previous transaction or not, which was
checked in the previous version. This might cause a negative value be assigned to nr_allocated_this_transaction which is declared
as an unsigned integer when a discard is performed. Though the result of calculating the number of free blocks in
sm_disk_get_nr_free() is still correct due to the unsigned integer arithmetic, I'm wondering whether it is tend to deal with it in
this way, or there should have some preliminaries before the update to nr_allocated_this_transaction? I'm willing to help if there
is any modification needed, or have a comment on it to avoid possible misuse in the future.

Thanks,
Ryan




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux