Skip to contentSkip to conversation

Patch "cifs: Fix missing error code set" has been added to the 6.10-stable tree

PATCH [email protected] 1 participant 1 message Jul 23, 2024

Subsystems (2)
lore
Share & tools
lore

[email protected]

author Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

cifs: Fix missing error code set

to the 6.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
cifs-fix-missing-error-code-set.patch
and it can be found in the queue-6.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

From d2c5eb57b6da10f335c30356f9696bd667601e6a Mon Sep 17 00:00:00 2001
From: David Howells <[email protected]>
Date: Thu, 18 Jul 2024 20:55:20 +0100
Subject: cifs: Fix missing error code set

From: David Howells <[email protected]>

commit d2c5eb57b6da10f335c30356f9696bd667601e6a upstream.

In cifs_strict_readv(), the default rc (-EACCES) is accidentally cleared by a successful return from netfs_start_io_direct(), such that if cifs_find_lock_conflict() fails, we don't return an error.

Fix this by resetting the default error code.

---
 fs/smb/client/file.c | 2 ++
 1 file changed, 2 insertions(+)
fs/smb/client/file.c +2 -0
index 1374635e89fa..6178c6d8097d 100644
@@ -2877,6 +2877,7 @@ cifs_strict_readv(struct kiocb *iocb, struct iov_iter *to)
 		rc = netfs_start_io_direct(inode);
 		if (rc < 0)
 			goto out;
+		rc = -EACCES;
 		down_read(&cinode->lock_sem);
 		if (!cifs_find_lock_conflict(
 			    cfile, iocb->ki_pos, iov_iter_count(to),
@@ -2889,6 +2890,7 @@ cifs_strict_readv(struct kiocb *iocb, struct iov_iter *to)
 		rc = netfs_start_io_read(inode);
 		if (rc < 0)
 			goto out;
+		rc = -EACCES;
 		down_read(&cinode->lock_sem);
 		if (!cifs_find_lock_conflict(
 			    cfile, iocb->ki_pos, iov_iter_count(to),
Signature · 10 lines
2.45.2



Patches currently in stable-queue which might be from [email protected] are

queue-6.10/cifs-fix-server-re-repick-on-subrequest-retry.patch
queue-6.10/cifs-fix-setting-of-zero_point-after-dio-write.patch
queue-6.10/cifs-fix-missing-error-code-set.patch
queue-6.10/cifs-fix-missing-fscache-invalidation.patch