Re: [PATCH V4 07/13] fs: Add locking for a dynamic address space operations state

From: Christoph Hellwig
Date: Fri Feb 21 2020 - 12:44:55 EST

On Thu, Feb 20, 2020 at 04:41:28PM -0800, ira.weiny@xxxxxxxxx wrote:
> From: Ira Weiny <ira.weiny@xxxxxxxxx>
> DAX requires special address space operations (aops). Changing DAX
> state therefore requires changing those aops.
> However, many functions require aops to remain consistent through a deep
> call stack.
> Define a vfs level inode rwsem to protect aops throughout call stacks
> which require them.
> Finally, define calls to be used in subsequent patches when aops usage
> needs to be quiesced by the file system.

I am very much against this. There is a reason why we don't support
changes of ops vectors at runtime anywhere else, because it is
horribly complicated and impossible to get right. IFF we ever want
to change the DAX vs non-DAX mode (which I'm still not sold on) the
right way is to just add a few simple conditionals and merge the
aops, which is much easier to reason about, and less costly in overall