linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] smb3: Miscellaneous fixes
@ 2023-02-23  8:15 David Howells
  2023-02-23  8:15 ` [PATCH 1/2] cifs: Add some missing xas_retry() calls David Howells
  2023-02-23  8:15 ` [PATCH 2/2] cifs: Fix an uninitialised variable David Howells
  0 siblings, 2 replies; 3+ messages in thread
From: David Howells @ 2023-02-23  8:15 UTC (permalink / raw)
  To: Steve French
  Cc: David Howells, Shyam Prasad N, Rohith Surabattula, Tom Talpey,
	Stefan Metzmacher, Matthew Wilcox, Jeff Layton, linux-cifs,
	linux-kernel

Hi Steve,

Here are a couple of fix patches for you.

I've pushed the patches here also:

	https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=iov-cifs

David

David Howells (2):
  cifs: Add some missing xas_retry() calls
  cifs: Fix an uninitialised variable

 fs/cifs/file.c      | 6 ++++++
 fs/cifs/smbdirect.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] cifs: Add some missing xas_retry() calls
  2023-02-23  8:15 [PATCH 0/2] smb3: Miscellaneous fixes David Howells
@ 2023-02-23  8:15 ` David Howells
  2023-02-23  8:15 ` [PATCH 2/2] cifs: Fix an uninitialised variable David Howells
  1 sibling, 0 replies; 3+ messages in thread
From: David Howells @ 2023-02-23  8:15 UTC (permalink / raw)
  To: Steve French
  Cc: David Howells, Shyam Prasad N, Rohith Surabattula, Tom Talpey,
	Stefan Metzmacher, Matthew Wilcox, Jeff Layton, linux-cifs,
	linux-kernel, Steve French

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")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Shyam Prasad N <nspmangalore@gmail.com>
cc: Rohith Surabattula <rohiths.msft@gmail.com>
cc: Tom Talpey <tom@talpey.com>
cc: Jeff Layton <jlayton@kernel.org>
cc: linux-cifs@vger.kernel.org
---
 fs/cifs/file.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 0e602173ac76..5c60f4044b65 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -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);


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] cifs: Fix an uninitialised variable
  2023-02-23  8:15 [PATCH 0/2] smb3: Miscellaneous fixes David Howells
  2023-02-23  8:15 ` [PATCH 1/2] cifs: Add some missing xas_retry() calls David Howells
@ 2023-02-23  8:15 ` David Howells
  1 sibling, 0 replies; 3+ messages in thread
From: David Howells @ 2023-02-23  8:15 UTC (permalink / raw)
  To: Steve French
  Cc: David Howells, Shyam Prasad N, Rohith Surabattula, Tom Talpey,
	Stefan Metzmacher, Matthew Wilcox, Jeff Layton, linux-cifs,
	linux-kernel, Steve French, linux-rdma

Fix an uninitialised variable introduced in cifs.

Fixes: 3d78fe73fa12 ("cifs: Build the RDMA SGE list directly from an iterator")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Shyam Prasad N <nspmangalore@gmail.com>
cc: Rohith Surabattula <rohiths.msft@gmail.com>
cc: Tom Talpey <tom@talpey.com>
cc: Jeff Layton <jlayton@kernel.org>
cc: linux-cifs@vger.kernel.org
cc: linux-rdma@vger.kernel.org
---
 fs/cifs/smbdirect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c
index 55b6e319a61d..0362ebd4fa0f 100644
--- a/fs/cifs/smbdirect.c
+++ b/fs/cifs/smbdirect.c
@@ -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 */


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-23  8:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-23  8:15 [PATCH 0/2] smb3: Miscellaneous fixes David Howells
2023-02-23  8:15 ` [PATCH 1/2] cifs: Add some missing xas_retry() calls David Howells
2023-02-23  8:15 ` [PATCH 2/2] cifs: Fix an uninitialised variable David Howells

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).