Skip to content
Snippets Groups Projects
Commit 3777501a authored by Jay Shin's avatar Jay Shin
Browse files

smb: client: fix chmod(2) regression with ATTR_READONLY

JIRA: https://issues.redhat.com/browse/RHEL-82677
Y-JIRA: https://issues.redhat.com/browse/RHEL-80534
Y-Commit: ff607656

O-JIRA: https://issues.redhat.com/browse/RHEL-80534



commit 654292a0b264e9b8c51b98394146218a21612aa1
Author: Paulo Alcantara <pc@manguebit.com>
Date:   Sun Feb 16 18:02:47 2025 -0300

    smb: client: fix chmod(2) regression with ATTR_READONLY

    When the user sets a file or directory as read-only (e.g. ~S_IWUGO),
    the client will set the ATTR_READONLY attribute by sending an
    SMB2_SET_INFO request to the server in cifs_setattr_{,nounix}(), but
    cifsInodeInfo::cifsAttrs will be left unchanged as the client will
    only update the new file attributes in the next call to
    {smb311_posix,cifs}_get_inode_info() with the new metadata filled in
    @data parameter.

    Commit a18280e7 ("smb: cilent: set reparse mount points as
    automounts") mistakenly removed the @data NULL check when calling
    is_inode_cache_good(), which broke the above case as the new
    ATTR_READONLY attribute would end up not being updated on files with a
    read lease.

    Fix this by updating the inode whenever we have cached metadata in
    @data parameter.

Reported-by: default avatarHorst Reiterer <horst.reiterer@fabasoft.com>
    Closes: https://lore.kernel.org/r/85a16504e09147a195ac0aac1c801280@fabasoft.com


    Fixes: a18280e7 ("smb: cilent: set reparse mount points as automounts")
    Cc: stable@vger.kernel.org
Signed-off-by: default avatarPaulo Alcantara (Red Hat) <pc@manguebit.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>

Signed-off-by: default avatarPaulo Alcantara <paalcant@redhat.com>

Signed-off-by: default avatarJay Shin <jaeshin@redhat.com>
parent 71a69216
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment