lkml.org 
[lkml]   [2019]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL 4.19 26/34] afs: Fix creation calls in the dynamic root to fail with EOPNOTSUPP
    Date
    From: David Howells <dhowells@redhat.com>

    [ Upstream commit 1da4bd9f9d187f53618890d7b66b9628bbec3c70 ]

    Fix the lookup method on the dynamic root directory such that creation
    calls, such as mkdir, open(O_CREAT), symlink, etc. fail with EOPNOTSUPP
    rather than failing with some odd error (such as EEXIST).

    lookup() itself tries to create automount directories when it is invoked.
    These are cached locally in RAM and not committed to storage.

    Signed-off-by: David Howells <dhowells@redhat.com>
    Reviewed-by: Marc Dionne <marc.dionne@auristor.com>
    Tested-by: Jonathan Billings <jsbillings@jsbillings.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    fs/afs/dynroot.c | 3 +++
    1 file changed, 3 insertions(+)

    diff --git a/fs/afs/dynroot.c b/fs/afs/dynroot.c
    index f29c6dade7f62..069273a2483f9 100644
    --- a/fs/afs/dynroot.c
    +++ b/fs/afs/dynroot.c
    @@ -145,6 +145,9 @@ static struct dentry *afs_dynroot_lookup(struct inode *dir, struct dentry *dentr

    ASSERTCMP(d_inode(dentry), ==, NULL);

    + if (flags & LOOKUP_CREATE)
    + return ERR_PTR(-EOPNOTSUPP);
    +
    if (dentry->d_name.len >= AFSNAMEMAX) {
    _leave(" = -ENAMETOOLONG");
    return ERR_PTR(-ENAMETOOLONG);
    --
    2.20.1
    \
     
     \ /
      Last update: 2019-12-20 15:35    [W:5.762 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site