Skip to contentSkip to conversation

smb3: Miscellaneous fixes

PATCH New David Howells 1 participant 3 messages Feb 23, 2023

Subsystems (3)
lore
Share & tools
lore
#1 lore raw

PATCH 1/2 cifs: Add some missing xas_retry() calls

The xas_for_each loops added into fs/cifs/file.c need to go round again if indicated by xas_retry().

Fixes 5f0955c98375 ("cifs: Add some helper functions")
cc Steve French <[email protected]>
cc Shyam Prasad N <[email protected]>
cc Rohith Surabattula <[email protected]>
cc Tom Talpey <[email protected]>
cc Jeff Layton <[email protected]>
---
 fs/cifs/file.c | 6 ++++++
 1 file changed, 6 insertions(+)
fs/cifs/file.c +6 -0
index 0e602173ac76..5c60f4044b65 100644
@@ -52,6 +52,8 @@ static void cifs_undirty_folios(struct inode *inode, loff_t start, unsigned int
 
 	end = (start + len - 1) / PAGE_SIZE;
 	xas_for_each_marked(&xas, folio, end, PAGECACHE_TAG_DIRTY) {
+		if (xas_retry(&xas, folio))
+			continue;
 		xas_pause(&xas);
 		rcu_read_unlock();
 		folio_lock(folio);
@@ -81,6 +83,8 @@ void cifs_pages_written_back(struct inode *inode, loff_t start, unsigned int len
 
 	end = (start + len - 1) / PAGE_SIZE;
 	xas_for_each(&xas, folio, end) {
+		if (xas_retry(&xas, folio))
+			continue;
 		if (!folio_test_writeback(folio)) {
 			WARN_ONCE(1, "bad %x @%llx page %lx %lx\n",
 				  len, start, folio_index(folio), end);
@@ -112,6 +116,8 @@ void cifs_pages_write_failed(struct inode *inode, loff_t start, unsigned int len
 
 	end = (start + len - 1) / PAGE_SIZE;
 	xas_for_each(&xas, folio, end) {
+		if (xas_retry(&xas, folio))
+			continue;
 		if (!folio_test_writeback(folio)) {
 			WARN_ONCE(1, "bad %x @%llx page %lx %lx\n",
 				  len, start, folio_index(folio), end);
#2 lore raw

PATCH 2/2 cifs: Fix an uninitialised variable

In reply to David Howells

Fix an uninitialised variable introduced in cifs.

Fixes 3d78fe73fa12 ("cifs: Build the RDMA SGE list directly from an iterator")
cc Steve French <[email protected]>
cc Shyam Prasad N <[email protected]>
cc Rohith Surabattula <[email protected]>
cc Tom Talpey <[email protected]>
cc Jeff Layton <[email protected]>
---
 fs/cifs/smbdirect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/smbdirect.c +1 -1
index 55b6e319a61d..0362ebd4fa0f 100644
@@ -837,7 +837,7 @@ static int smbd_post_send_iter(struct smbd_connection *info,
 	int data_length;
 	struct smbd_request *request;
 	struct smbd_data_transfer *packet;
-	int new_credits;
+	int new_credits = 0;
 
 wait_credit:
 	/* Wait for send credits. A SMBD packet needs one credit */