On 1/9/20 2:16 AM, Qu Wenruo wrote:
When btrfs_update_device() failed due to ENOMEM, we didn't reset device size back to its original size, causing the in-memory device size larger than original. If somehow the memory pressure get solved, and the fs committed, since the device item is not updated, but super block total size get updated, it would cause mount failure due to size mismatch. So here revert device size and super size to its original size when btrfs_update_device() failed, just like what we did in shrink_device(). Signed-off-by: Qu Wenruo <wqu@xxxxxxxx>
Did you test this with error injection to make sure nothing else wonky came out of this? If you are going to fix this I'd rather it be in a different series because it's not necessarily related to what you are doing, and isn't any more broken with your other patches. The thing you are fixing in this series is important and I'd rather not hold it up on some error handling shenanigans. Thanks,
Josef
