Re: [RFC-PATCH] nfsd: when unhashing openowners, increment openowner's refcount

J. Bruce Fields
2019-08-27T20:51:59Z

On Tue, Aug 27, 2019 at 12:05:28PM +0300, Alex Lyakas wrote:
> Is the described issue familiar to you?

Yep, got it, but I haven't seen anyone try to solve it using the fault
injection code, that's interesting!

There's also fs/nfsd/unlock_filesystem. It only unlocks NLM (NFSv3)
locks. But it'd probably be reasonable to teach it to get NFSv4 state
too (locks, opens, delegations, and layouts).

But my feeling's always been that the cleanest way to do it is to create
two containers with separate net namespaces and run nfsd in both of
them. You can start and stop the servers in the different containers
independently.

> It is very easily reproducible. What is the way to solve it? To our
> understanding, if we un-export a FS from nfsd, we should be able to
> unmount it.

Unexporting has never removed locks or opens or other state, for what
it's worth.

--b.