{"id":809706,"url":"http://patchwork.ozlabs.org/api/1.2/patches/809706/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/patch/150453530801.20359.17059994007095255872.stgit@warthog.procyon.org.uk/","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/1.2/projects/7/?format=json","name":"Linux network development","link_name":"netdev","list_id":"netdev.vger.kernel.org","list_email":"netdev@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<150453530801.20359.17059994007095255872.stgit@warthog.procyon.org.uk>","list_archive_url":null,"date":"2017-09-04T14:28:28","name":"[net-next] rxrpc: Make service connection lookup always check for retry","commit_ref":null,"pull_url":null,"state":"accepted","archived":true,"hash":"d2c65e74e41cd34083e7c2f34e4b335efbfeaba0","submitter":{"id":59,"url":"http://patchwork.ozlabs.org/api/1.2/people/59/?format=json","name":"David Howells","email":"dhowells@redhat.com"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/1.2/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/150453530801.20359.17059994007095255872.stgit@warthog.procyon.org.uk/mbox/","series":[{"id":1397,"url":"http://patchwork.ozlabs.org/api/1.2/series/1397/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/list/?series=1397","date":"2017-09-04T14:28:28","name":"[net-next] rxrpc: Make service connection lookup always check for retry","version":1,"mbox":"http://patchwork.ozlabs.org/series/1397/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/809706/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/809706/checks/","tags":{},"related":[],"headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=dhowells@redhat.com"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xmBzd68yQz9s7h\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue,  5 Sep 2017 00:28:45 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753662AbdIDO2b (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 4 Sep 2017 10:28:31 -0400","from mx1.redhat.com ([209.132.183.28]:40424 \"EHLO mx1.redhat.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1753566AbdIDO23 (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tMon, 4 Sep 2017 10:28:29 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id ACBDC806D5;\n\tMon,  4 Sep 2017 14:28:29 +0000 (UTC)","from warthog.procyon.org.uk (ovpn-124-227.rdu2.redhat.com\n\t[10.10.124.227])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id EEFBA125255;\n\tMon,  4 Sep 2017 14:28:28 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com ACBDC806D5","Organization":"Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley\n\tPlace, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United\n\tKingdom.\n\tRegistered in England and Wales under Company Registration No.\n\t3798903","Subject":"[PATCH net-next] rxrpc: Make service connection lookup always check\n\tfor retry","From":"David Howells <dhowells@redhat.com>","To":"netdev@vger.kernel.org","Cc":"dhowells@redhat.com, linux-afs@lists.infradead.org,\n\tlinux-kernel@vger.kernel.org","Date":"Mon, 04 Sep 2017 15:28:28 +0100","Message-ID":"<150453530801.20359.17059994007095255872.stgit@warthog.procyon.org.uk>","User-Agent":"StGit/0.17.1-dirty","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.26]);\n\tMon, 04 Sep 2017 14:28:29 +0000 (UTC)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"},"content":"When an RxRPC service packet comes in, the target connection is looked up\nby an rb-tree search under RCU and a read-locked seqlock; the seqlock retry\ncheck is, however, currently skipped if we got a match, but probably\nshouldn't be in case the connection we found gets replaced whilst we're\ndoing a search.\n\nMake the lookup procedure always go through need_seqretry(), even if the\nlookup was successful.  This makes sure we always pick up on a write-lock\nevent.\n\nOn the other hand, since we don't take a ref on the object, but rely on RCU\nto prevent its destruction after dropping the seqlock, I'm not sure this is\nnecessary.\n\nSigned-off-by: David Howells <dhowells@redhat.com>\n---\n\n net/rxrpc/conn_service.c |    3 +--\n 1 file changed, 1 insertion(+), 2 deletions(-)","diff":"diff --git a/net/rxrpc/conn_service.c b/net/rxrpc/conn_service.c\nindex e60fcd2a4a02..f6fcdb3130a1 100644\n--- a/net/rxrpc/conn_service.c\n+++ b/net/rxrpc/conn_service.c\n@@ -50,12 +50,11 @@ struct rxrpc_connection *rxrpc_find_service_conn_rcu(struct rxrpc_peer *peer,\n \t\t\telse if (conn->proto.index_key > k.index_key)\n \t\t\t\tp = rcu_dereference_raw(p->rb_right);\n \t\t\telse\n-\t\t\t\tgoto done;\n+\t\t\t\tbreak;\n \t\t\tconn = NULL;\n \t\t}\n \t} while (need_seqretry(&peer->service_conn_lock, seq));\n \n-done:\n \tdone_seqretry(&peer->service_conn_lock, seq);\n \t_leave(\" = %d\", conn ? conn->debug_id : -1);\n \treturn conn;\n","prefixes":["net-next"]}