From: Suresh Jayaraman <sjayaraman-IBi9RG/b67k@public.gmane.org>
To: Steve French <sfrench-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
Cc: linux-cifs <linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: [PATCH] cifs: WARN_ON_ONCE if kernel_sendmsg() returns -ENOSPC
Date: Wed, 03 Oct 2012 21:27:12 +0530 [thread overview]
Message-ID: <506C6058.6060008@suse.com> (raw)
kernel_sendmsg() is less likely to return -ENOSPC and it might be
a bug to do so. However, in the past there might have been cases
where a -ENOSPC was returned from a low level driver.
Add a WARN_ON_ONCE() to ensure that it is safe to assume that -ENOSPC
is no longer returned. This -ENOSPC specific handling will be removed
once we are sure it is no longer returned.
Cc: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Suresh Jayaraman <sjayaraman-IBi9RG/b67k@public.gmane.org>
---
fs/cifs/transport.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index d9b639b..c613fca 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -155,6 +155,12 @@ smb_sendv(struct TCP_Server_Info *server, struct kvec *iov, int n_vec)
rc = kernel_sendmsg(ssocket, &smb_msg, &iov[first_vec],
n_vec - first_vec, total_len);
if ((rc == -ENOSPC) || (rc == -EAGAIN)) {
+ /*
+ * Catch if a low level driver returns -ENOSPC. This
+ * WARN_ON will be removed by 3.10 if no one reports
+ * seeing this.
+ */
+ WARN_ON_ONCE(rc == -ENOSPC);
i++;
/*
* If blocking send we try 3 times, since each can block
next reply other threads:[~2012-10-03 15:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-03 15:57 Suresh Jayaraman [this message]
[not found] ` <506C6058.6060008-IBi9RG/b67k@public.gmane.org>
2012-10-03 16:24 ` [PATCH] cifs: WARN_ON_ONCE if kernel_sendmsg() returns -ENOSPC Jeff Layton
[not found] ` <20121003122417.51c52f31-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2012-10-03 19:16 ` Steve French
-- strict thread matches above, loose matches on Subject: below --
2012-10-03 7:15 Suresh Jayaraman
[not found] ` <506BE618.7050606-IBi9RG/b67k@public.gmane.org>
2012-10-03 10:04 ` Jeff Layton
[not found] ` <20121003060410.07c30803-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2012-10-03 15:43 ` Suresh Jayaraman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=506C6058.6060008@suse.com \
--to=sjayaraman-ibi9rg/b67k@public.gmane.org \
--cc=jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sfrench-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.