On 21.06.2018 17:02, Qu Wenruo wrote:
> 
> 
> On 2018年06月21日 21:58, David Sterba wrote:
>> On Wed, Jun 20, 2018 at 03:38:58PM +0800, Qu Wenruo wrote:
>>> Commit f8f84b2dfda5 ("btrfs: index check-integrity state hash by a dev_t")
>>> changed how btrfsic how we index device state hash.
>>>
>>> Now we need to access device->bdev->bd_dev, while for degraded mount
>>> it's completely possible to have device->bdev as NULL, thus it will
>>> trigger a NULL pointer dereference at mount time.
>>>
>>> Fix it by checking if the device is degraded before accessing
>>> device->bdev->bd_dev.
>>>
>>> There are a lot of other places accessing device->bdev->bd_dev, however
>>> the other call sites have either checked device->bdev, or the
>>> device->bdev is passed from btrfsic_map_block(), so it won't cause harm.
>>>
>>> Fixes: f8f84b2dfda5 ("btrfs: index check-integrity state hash by a dev_t")
>>> Signed-off-by: Qu Wenruo <w...@suse.com>
>>
>> Added to misc-next. As it is a fix it could go to 4.18 but I'd rather
>> have a good reason for that because it's in a debugging feature.
> 
> No need to push it to 4.18.
> 
> Indeed it's a debug feature, and furthermore, there are tons of bugs
> exposed by fstests, so it's better to fix it as a large serious patchset.
> 

If buffer heads are eliminated from btrfs then we can remove a
substantial portion of the integrity checking code.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to