On 03/28/2017 11:38 PM, David Sterba wrote:
On Mon, Mar 13, 2017 at 03:42:12PM +0800, Anand Jain wrote:
The only error that write dev flush (send) will fail is due
to the ENOMEM then, as its not a device specific error and
rather a system wide issue, we should rather stop further
iterations and perpetuate the -ENOMEM error to the caller.
I think we should try harder, as flushing is a critical operation and a
simple yet unlikely memory allocation failure should not stop it.
The device::flush_bio is being allocated each time we start flush and
freed afterwards. This seems unnecessary. The proper fix IMO is to
preallocate the bio at the time the device is added to the list. The bio
lifetime is same as the device'.
I agree. Also as we are using an empty bio with
the REQ_PREFLUSH flag we have the opportunity to use
blkdev_issue_flush() instead. And bio is in fact
does the prealloc part.
Will use blkdev_issue_flush() and submit the patch
again.
Thanks, Anand
--
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