linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][WIP] do not ignore error on setinfo for chmod
@ 2019-08-01 18:05 Steve French
  0 siblings, 0 replies; only message in thread
From: Steve French @ 2019-08-01 18:05 UTC (permalink / raw)
  To: CIFS

[-- Attachment #1: Type: text/plain, Size: 95 bytes --]

We were incorrectly skipping errors in some cases in cifs_settattr_nounix


-- 
Thanks,

Steve

[-- Attachment #2: 0001-cifs-fix-error-handling-on-chmod.patch --]
[-- Type: text/x-patch, Size: 1642 bytes --]

From d8423388e07b16dc508ed453637879f47bebd1b1 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Thu, 1 Aug 2019 12:21:14 -0500
Subject: [PATCH] cifs: fix error handling on chmod

We were ignoring errors on chmod due to incorrect check of
which attributes were being changed (certain timestamp setting
errors can be safely ignored but not chmod).

Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/cifs/inode.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 26cdfbf1e164..25a5aeddc09a 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -2559,12 +2559,14 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
 		/* BB: check for rc = -EOPNOTSUPP and switch to legacy mode */
 
 		/* Even if error on time set, no sense failing the call if
-		the server would set the time to a reasonable value anyway,
-		and this check ensures that we are not being called from
-		sys_utimes in which case we ought to fail the call back to
-		the user when the server rejects the call */
-		if ((rc) && (attrs->ia_valid &
-				(ATTR_MODE | ATTR_GID | ATTR_UID | ATTR_SIZE)))
+		 * the server would set the time to a reasonable value anyway.
+		 * TODO check if check to ensure that are not being called from
+		 * sys_utimes (in which case we ought to fail the call when the
+		 * server rejects the call) is correct. We do want
+	         * to return an rc if error setting mode or owner or size
+		 */
+		if (rc && ((attrs->ia_valid &
+		      (ATTR_MODE | ATTR_GID | ATTR_UID | ATTR_SIZE)) == 0))
 			rc = 0;
 	}
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-01 18:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-01 18:05 [PATCH][WIP] do not ignore error on setinfo for chmod Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).