lkml.org 
[lkml]   [2022]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH v4 38/68] vfs, cachefiles: Mark a backing file in use with an inode flag
    Date
    Amir Goldstein <amir73il@gmail.com> wrote:

    > > - if (is_local_mountpoint(dentry))
    > > + if (is_local_mountpoint(dentry) ||
    > > + (dentry->d_inode->i_flags & S_KERNEL_FILE))
    >
    > Better as this check to the many other checks in may_delete()

    Okay. It will make things a bit more complicated, so I'll do it in a follow
    up patch. The problem is that it will prevent the cachefiles driver in the
    kernel from renaming directories and unlinking files as it's currently
    removing the mark *after* moving/deleting them.

    > > +#define S_KERNEL_FILE (1 << 17) /* File is in use by the kernel (eg. fs/cachefiles) */
    > >
    >
    > Trying to brand this flag as a generic "in use by kernel" is misleading.
    > Modules other than cachefiles cannot set/clear this flag, because then
    > cachefiles won't know that it is allowed to set/clear the flag.

    If the flag is set, then cachefiles thinks some other kernel driver is using
    the file and it shouldn't try to use it. It doesn't matter who has it open.

    It should never happen as other kernel drivers shouldn't be poking around
    inside cachefiles's cache, but possibly someone could misconfigure something.

    David

    \
     
     \ /
      Last update: 2022-01-08 09:42    [W:4.022 / U:0.292 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site