]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ocfs2/o2net: incorrect to terminate accepting connections loop upon rejecting an...
authorTariq Saeed <tariq.x.saeed@oracle.com>
Wed, 14 May 2014 00:01:27 +0000 (10:01 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 14 May 2014 00:01:27 +0000 (10:01 +1000)
Orabug: 17489469

When o2net-accept-one() rejects an illegal connection, it terminates the
loop picking up the remaining queued connections.  This fix will continue
accepting connections till the queue is emtpy.

Signed-off-by: Tariq Saseed <tariq.x.saeed@oracle.com>
Signed-off-by: Srinivas Eeda <srinivas.eeda@oracle.com>
Cc: Joel Becker <jlbec@evilplan.org>
Reviewed-by: Mark Fasheh <mfasheh@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ocfs2/cluster/tcp.c

index 40cc827afcde30ece49f78cae18977663ca67614..681691bc233a1d8991ba4ec5ad1512524afd1b8d 100644 (file)
@@ -1921,12 +1921,30 @@ out:
        return ret;
 }
 
+/*
+ * This function is invoked in response to one or more
+ * pending accepts at softIRQ level. We must drain the
+ * entire que before returning.
+ */
+
 static void o2net_accept_many(struct work_struct *work)
 {
        struct socket *sock = o2net_listen_sock;
        int     more;
        int     err;
 
+       /*
+        * It is critical to note that due to interrupt moderation
+        * at the network driver level, we can't assume to get a
+        * softIRQ for every single conn since tcp SYN packets
+        * can arrive back-to-back, and therefore many pending
+        * accepts may result in just 1 softIRQ. If we terminate
+        * the o2net_accept_one() loop upon seeing an err, what happens
+        * to the rest of the conns in the queue? If no new SYN
+        * arrives for hours, no softIRQ  will be delivered,
+        * and the connections will just sit in the queue.
+        */
+
        for (;;) {
                err = o2net_accept_one(sock, &more);
                if (!more)