On Tue, Apr 04, 2017 at 06:41:44PM +0800, Anand Jain wrote: > blkdev_issue_flush() or the empty buffer with the flag REQ_PREFLUSH > will never return BIO_EOPNOTSUPP as of now, however it should rather > or it may in future. So for now the BTRFS to have least affected by > this change at the blk layer, we can check if the device is flush > capable. > > In this process, I rename the unused nobarrier member as flushable, > which the below patch made it redundant. > > Per commit b25de9d6da49b1a8760a89672283128aa8c78345 > block: remove BIO_EOPNOTSUPP > > Signed-off-by: Anand Jain <anand.jain@xxxxxxxxxx> So up to now, dev->nobarriers was always 0 and thus write_dev_flush always sent down the empty bio with PREFLUSH. Depending on the actual device flush capabilities, it either kept the flush bit or removed it in the generic_make_request_checks, and then proceeded to generic_make_request. In short, we always sent the flush bio. What your patch changes is that this will happen only for devices that have the flush capability, determined by the queue bit. This change does not seem to contradict the commit 387125fc722a8ed432066b85a552917343bdafca that brought the dev->nobarriers, so regarding metadata ordering and superblock flushes, all seem ok. But this could use some doublechecking. -- 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
