On Thu, Nov 10, 2016 at 12:06:01PM -0800, Christoph Hellwig wrote: > Hi all, > > btrfs_check_repairable and bio_readpage_error have somewhat odd > looking check for bi_vcnt, checking on how to proceed based on that. > > Does anyone remember what they actually are checking for? Depending > on the exact devices merging bi_vcnt can mean quite a few different > things, and we should probably check for what people actually intended > to check. (These two guys have been silent for some time. :) ) Try to explain it a bit, the following assumes that the data that's being read has at least one copy in another device, if a read bio contains two pages and the second one is failing on checksum check, then we get into bio_readpage_error, in which it finds this bio has two pages, so it creats a new bio (so-called validation request) which only includes the fail-on-checksum victim page and issues it with REQ_FAILFAST_DEV to read the page again in hope of passing the checksum check, if it stills fails somehow, it comes into bio_readpage_error again to do another try but along with a different copy. Overall, this bi_vcnt is to tell whether the bio is a normal one and a validation one. If the validation bio got merged somehow, then we need to do something to prevent that from happening. Thanks, -liubo -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
