Re: [PATCH v2] fs: rename S_KERNEL_FILE

From: David Howells
Date: Fri Jan 28 2022 - 06:36:11 EST


Amir Goldstein <amir73il@xxxxxxxxx> wrote:

> Good idea, but then the helpers to set the flag should not be internal
> to cachefiles and the locking semantics should be clear.

I could move them out, at least partially. They do log some information
that's private to cachefiles through the tracepoint, but it's just one number
and could be passed in as a parameter. I could move the tracepoint to
somewhere more generic.

> FYI, overlayfs already takes an "exclusive lock" on upper/work dir
> among all ovl instances.
>
> How do you feel about hoisting ovl_inuse_* helpers to fs.h
> and rename s/I_OVL_INUSE/I_EXCL_INUSE?

Fine by me. Sharing a cache with or through an overlay would make for very
fun coherency management.

> Whether deny rmdir should have its own flag or not I don't know,
> but from ovl POV I *think* it should not be a problem to deny rmdir
> for the ovl upper/work dirs as long as ovl is mounted(?).

What's the consequence of someone rearranging the directories directly in the
contributing dirs whilst there's an overlay over them?

> Another problem with generic deny of rmdir is that users getting
> EBUSY have no way to figure out the reason.
> At least for a specific subsystem (i.e. cachefiles) users should be able
> to check if the denied dir is in the subsystem's inventory(?)

I could add a tracepoint for that. It could form a set with the cachefiles
tracepoints if I move those out too.

David