From: "Pali Rohár" <pali@kernel.org>
To: Steve French <sfrench@samba.org>,
Paulo Alcantara <pc@manguebit.com>,
Ronnie Sahlberg <ronniesahlberg@gmail.com>
Cc: linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] cifs: Do not issue SMB2 CREATE always with FILE_READ_ATTRIBUTES
Date: Sat, 5 Oct 2024 18:08:25 +0200 [thread overview]
Message-ID: <20241005160826.20825-2-pali@kernel.org> (raw)
In-Reply-To: <20241005160826.20825-1-pali@kernel.org>
Not all SMB2 operations require FILE_READ_ATTRIBUTES access and therefore
do not automatically request for FILE_READ_ATTRIBUTES access in every one
SMB2 CREATE command.
This change allows to complete WRITE operation to a file when it does not
grant FILE_READ_ATTRIBUTES permission and its parent directory does not
grant READ_DATA permission (parent directory READ_DATA is implicit grant of
child FILE_READ_ATTRIBUTES permission).
Signed-off-by: Pali Rohár <pali@kernel.org>
---
fs/smb/client/smb2file.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/smb/client/smb2file.c b/fs/smb/client/smb2file.c
index 149449d9c1c0..faa634ce4d54 100644
--- a/fs/smb/client/smb2file.c
+++ b/fs/smb/client/smb2file.c
@@ -162,7 +162,6 @@ int smb2_open_file(const unsigned int xid, struct cifs_open_parms *oparms, __u32
if (smb2_path == NULL)
return -ENOMEM;
- oparms->desired_access |= FILE_READ_ATTRIBUTES;
smb2_oplock = SMB2_OPLOCK_LEVEL_BATCH;
rc = SMB2_open(xid, oparms, smb2_path, &smb2_oplock, smb2_data, NULL, &err_iov,
--
2.20.1
next prev parent reply other threads:[~2024-10-05 16:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-05 16:08 [PATCH 0/2] cifs: Improve access without FILE_READ_ATTRIBUTES permission Pali Rohár
2024-10-05 16:08 ` Pali Rohár [this message]
2024-10-05 16:08 ` [PATCH 2/2] cifs: Improve stat() to work also without FILE_READ_ATTRIBUTES Pali Rohár
2024-10-05 18:32 ` [PATCH 0/2] cifs: Improve access without FILE_READ_ATTRIBUTES permission Steve French
2024-10-05 18:44 ` Pali Rohár
2024-10-28 10:34 ` Pali Rohár
2024-12-22 13:20 ` [PATCH v2 " Pali Rohár
2024-12-22 13:20 ` [PATCH v2 1/2] cifs: Add fallback for SMB2 CREATE without FILE_READ_ATTRIBUTES Pali Rohár
2024-12-22 13:20 ` [PATCH v2 2/2] cifs: Improve stat() to work also " Pali Rohár
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241005160826.20825-2-pali@kernel.org \
--to=pali@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pc@manguebit.com \
--cc=ronniesahlberg@gmail.com \
--cc=sfrench@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.