lkml.org 
[lkml]   [2022]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    SubjectRe: [PATCH v6] cifs: Support fscache indexing rewrite
    Date
    David Howells <dhowells@redhat.com> wrote:

    > - /*
    > - * The cookie is initialized from volume info returned above.
    > - * Inside cifs_fscache_get_super_cookie it checks
    > - * that we do not get super cookie twice.
    > - */
    > - cifs_fscache_get_super_cookie(tcon);
    > + if (!rc &&
    > + (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_FSCACHE)) {
    > + /*
    > + * The cookie is initialized from volume info returned above.
    > + * Inside cifs_fscache_get_super_cookie it checks
    > + * that we do not get super cookie twice.
    > + */
    > + rc = cifs_fscache_get_super_cookie(tcon);
    > + if (rc < 0) {
    > + iget_failed(inode);
    > + inode = ERR_PTR(rc);
    > + }
    > + }

    This bit should've been removed - and the bit it is modifying was removed by
    commit b774302e885697dde027825f8de9beb985d037bd which is now upstream.

    The invocation of cifs_fscache_get_super_cookie() added by that commit should
    be altered to make it conditional.

    To this end, I've rebased the patch on linus/master and something
    approximating the attached change needs to be made.

    David
    ---
    diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
    index f977e02bd21e..598be9890f2a 100644
    --- a/fs/cifs/connect.c
    +++ b/fs/cifs/connect.c
    @@ -3057,7 +3057,8 @@ static int mount_get_conns(struct mount_ctx *mnt_ctx)
    * Inside cifs_fscache_get_super_cookie it checks
    * that we do not get super cookie twice.
    */
    - cifs_fscache_get_super_cookie(tcon);
    + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_FSCACHE)
    + cifs_fscache_get_super_cookie(tcon);

    out:
    mnt_ctx->server = server;
    diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
    index 3c3bc28090d8..9b93e7d3e0e1 100644
    --- a/fs/cifs/inode.c
    +++ b/fs/cifs/inode.c
    @@ -1368,20 +1368,6 @@ struct inode *cifs_root_iget(struct super_block *sb)
    inode = ERR_PTR(rc);
    }

    - if (!rc &&
    - (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_FSCACHE)) {
    - /*
    - * The cookie is initialized from volume info returned above.
    - * Inside cifs_fscache_get_super_cookie it checks
    - * that we do not get super cookie twice.
    - */
    - rc = cifs_fscache_get_super_cookie(tcon);
    - if (rc < 0) {
    - iget_failed(inode);
    - inode = ERR_PTR(rc);
    - }
    - }
    -
    out:
    kfree(path);
    free_xid(xid);
    \
     
     \ /
      Last update: 2022-01-13 17:21    [W:4.067 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site