All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/4] cifs: Fix in error types returned for out-of-credit situations.
@ 2021-02-04  8:08 Shyam Prasad N
  2021-02-04  8:09 ` Shyam Prasad N
  0 siblings, 1 reply; 5+ messages in thread
From: Shyam Prasad N @ 2021-02-04  8:08 UTC (permalink / raw)
  To: Steve French, Pavel Shilovsky, tom, ronnie sahlberg, CIFS

-- 
Regards,
Shyam

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

* Re: [PATCH 2/4] cifs: Fix in error types returned for out-of-credit situations.
  2021-02-04  8:08 [PATCH 2/4] cifs: Fix in error types returned for out-of-credit situations Shyam Prasad N
@ 2021-02-04  8:09 ` Shyam Prasad N
  2021-02-04 10:16   ` Aurélien Aptel
  0 siblings, 1 reply; 5+ messages in thread
From: Shyam Prasad N @ 2021-02-04  8:09 UTC (permalink / raw)
  To: Steve French, Pavel Shilovsky, tom, ronnie sahlberg, CIFS

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

On Thu, Feb 4, 2021 at 12:08 AM Shyam Prasad N <nspmangalore@gmail.com> wrote:
>
> --
> Regards,
> Shyam



-- 
Regards,
Shyam

[-- Attachment #2: 0002-cifs-Fix-in-error-types-returned-for-out-of-credit-s.patch --]
[-- Type: application/octet-stream, Size: 1972 bytes --]

From 737b8d71d9cc3ef2b2484f246cec4b8135e576d4 Mon Sep 17 00:00:00 2001
From: Shyam Prasad N <sprasad@microsoft.com>
Date: Wed, 3 Feb 2021 22:58:38 -0800
Subject: [PATCH 2/4] cifs: Fix in error types returned for out-of-credit
 situations.

For failure by timeout waiting for credits, changed the error
returned to the app with EBUSY, instead of ENOTSUPP. This is done
because this situation is possible even in non-buggy cases. i.e.
overloaded server can return 0 credits until done with outstanding
requests. And this feels like a better error to return to the app.

For cases of zero credits found even when there are no requests
in flight, replaced ENOTSUPP with EDEADLK, since we're avoiding
deadlock here by returning error.

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
---
 fs/cifs/transport.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index 41223a9ee086..39e87705840d 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -567,7 +567,7 @@ wait_for_free_credits(struct TCP_Server_Info *server, const int num_credits,
 					server->hostname, num_credits, 0);
 				cifs_server_dbg(VFS, "wait timed out after %d ms\n",
 					 timeout);
-				return -ENOTSUPP;
+				return -EBUSY;
 			}
 			if (rc == -ERESTARTSYS)
 				return -ERESTARTSYS;
@@ -609,7 +609,7 @@ wait_for_free_credits(struct TCP_Server_Info *server, const int num_credits,
 						0);
 					cifs_server_dbg(VFS, "wait timed out after %d ms\n",
 						 timeout);
-					return -ENOTSUPP;
+					return -EBUSY;
 				}
 				if (rc == -ERESTARTSYS)
 					return -ERESTARTSYS;
@@ -687,7 +687,7 @@ wait_for_compound_request(struct TCP_Server_Info *server, int num,
 					server->hostname, scredits, sin_flight);
 			cifs_dbg(FYI, "%s: %d requests in flight, needed %d total=%d\n",
 					__func__, sin_flight, num, scredits);
-			return -ENOTSUPP;
+			return -EDEADLK;
 		}
 	}
 	spin_unlock(&server->req_lock);
-- 
2.25.1


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

* Re: [PATCH 2/4] cifs: Fix in error types returned for out-of-credit situations.
  2021-02-04  8:09 ` Shyam Prasad N
@ 2021-02-04 10:16   ` Aurélien Aptel
  2021-02-04 16:49     ` Steve French
  0 siblings, 1 reply; 5+ messages in thread
From: Aurélien Aptel @ 2021-02-04 10:16 UTC (permalink / raw)
  To: Shyam Prasad N, Steve French, Pavel Shilovsky, tom,
	ronnie sahlberg, CIFS

Shyam Prasad N <nspmangalore@gmail.com> writes:
> For cases of zero credits found even when there are no requests
> in flight, replaced ENOTSUPP with EDEADLK, since we're avoiding
> deadlock here by returning error.

Seems ok. libc can have different behaviours depending on error but it
should be ok I think and better than ENOTSUPP.

Reviewed-by: Aurelien Aptel <aaptel@suse.com>

Cheers,
-- 
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, DE
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 247165 (AG München)


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

* Re: [PATCH 2/4] cifs: Fix in error types returned for out-of-credit situations.
  2021-02-04 10:16   ` Aurélien Aptel
@ 2021-02-04 16:49     ` Steve French
  2021-02-16 12:31       ` Shyam Prasad N
  0 siblings, 1 reply; 5+ messages in thread
From: Steve French @ 2021-02-04 16:49 UTC (permalink / raw)
  To: Aurélien Aptel
  Cc: Shyam Prasad N, Pavel Shilovsky, Tom Talpey, ronnie sahlberg, CIFS

Is it safe enough to cc:stable?  Is it important enough to get this
fix in ASAP for 5.11-rc7 vs. 5.12?

On Thu, Feb 4, 2021 at 4:16 AM Aurélien Aptel <aaptel@suse.com> wrote:
>
> Shyam Prasad N <nspmangalore@gmail.com> writes:
> > For cases of zero credits found even when there are no requests
> > in flight, replaced ENOTSUPP with EDEADLK, since we're avoiding
> > deadlock here by returning error.
>
> Seems ok. libc can have different behaviours depending on error but it
> should be ok I think and better than ENOTSUPP.
>
> Reviewed-by: Aurelien Aptel <aaptel@suse.com>
>
> Cheers,
> --
> Aurélien Aptel / SUSE Labs Samba Team
> GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
> SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, DE
> GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 247165 (AG München)
>


-- 
Thanks,

Steve

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

* Re: [PATCH 2/4] cifs: Fix in error types returned for out-of-credit situations.
  2021-02-04 16:49     ` Steve French
@ 2021-02-16 12:31       ` Shyam Prasad N
  0 siblings, 0 replies; 5+ messages in thread
From: Shyam Prasad N @ 2021-02-16 12:31 UTC (permalink / raw)
  To: Steve French
  Cc: Aurélien Aptel, Pavel Shilovsky, Tom Talpey, ronnie sahlberg, CIFS

5.12 should be fine.

On Thu, Feb 4, 2021 at 8:49 AM Steve French <smfrench@gmail.com> wrote:
>
> Is it safe enough to cc:stable?  Is it important enough to get this
> fix in ASAP for 5.11-rc7 vs. 5.12?
>
> On Thu, Feb 4, 2021 at 4:16 AM Aurélien Aptel <aaptel@suse.com> wrote:
> >
> > Shyam Prasad N <nspmangalore@gmail.com> writes:
> > > For cases of zero credits found even when there are no requests
> > > in flight, replaced ENOTSUPP with EDEADLK, since we're avoiding
> > > deadlock here by returning error.
> >
> > Seems ok. libc can have different behaviours depending on error but it
> > should be ok I think and better than ENOTSUPP.
> >
> > Reviewed-by: Aurelien Aptel <aaptel@suse.com>
> >
> > Cheers,
> > --
> > Aurélien Aptel / SUSE Labs Samba Team
> > GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
> > SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, DE
> > GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 247165 (AG München)
> >
>
>
> --
> Thanks,
>
> Steve



-- 
Regards,
Shyam

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

end of thread, other threads:[~2021-02-16 12:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-04  8:08 [PATCH 2/4] cifs: Fix in error types returned for out-of-credit situations Shyam Prasad N
2021-02-04  8:09 ` Shyam Prasad N
2021-02-04 10:16   ` Aurélien Aptel
2021-02-04 16:49     ` Steve French
2021-02-16 12:31       ` Shyam Prasad N

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.