Re: [PATCH 1/2] Block layer filter - second version

From: Matthew Wilcox
Date: Wed Oct 21 2020 - 07:45:04 EST


On Wed, Oct 21, 2020 at 09:21:36AM +0000, Damien Le Moal wrote:
> > + * submit_bio_direct - submit a bio to the block device layer for I/O
> > + * bypass filter.
> > + * @bio: The bio describing the location in memory and on the device.
> > *
> > + * Description:

You don't need this line.

> > + * This is a version of submit_bio() that shall only be used for I/O
> > + * that cannot be intercepted by block layer filters.
> > + * All file systems and other upper level users of the block layer
> > + * should use submit_bio() instead.
> > + * Use this function to access the swap partition and directly access
> > + * the block device file.

I don't understand why O_DIRECT gets to bypass the block filter. Nor do
I understand why anybody would place a block filter on the swap device.
But if somebody did place a filter on the swap device, why should swap
be able to bypass the filter?