From patchwork Thu Nov 8 05:10:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Davidlohr Bueso X-Patchwork-Id: 10673487 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B565C15E9 for ; Thu, 8 Nov 2018 05:10:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A60362D683 for ; Thu, 8 Nov 2018 05:10:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A7FC2D798; Thu, 8 Nov 2018 05:10:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 546AB2D683 for ; Thu, 8 Nov 2018 05:10:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729004AbeKHOoJ (ORCPT ); Thu, 8 Nov 2018 09:44:09 -0500 Received: from smtp2.provo.novell.com ([137.65.250.81]:45309 "EHLO smtp2.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728965AbeKHOoI (ORCPT ); Thu, 8 Nov 2018 09:44:08 -0500 Received: from linux-r8p5.suse.de (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by smtp2.provo.novell.com with ESMTP (TLS encrypted); Wed, 07 Nov 2018 22:10:20 -0700 From: Davidlohr Bueso To: akpm@linux-foundation.org Cc: jbaron@akamai.com, viro@zeniv.linux.org.uk, dave@stgolabs.net, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: [PATCH 4/6] fs/epoll: robustify ep->mtx held checks Date: Wed, 7 Nov 2018 21:10:04 -0800 Message-Id: <20181108051006.18751-5-dave@stgolabs.net> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20181108051006.18751-1-dave@stgolabs.net> References: <20181108051006.18751-1-dave@stgolabs.net> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Insted of just commenting how important it is, lets make it more robust and add a lockdep_assert_held() call. Signed-off-by: Davidlohr Bueso --- fs/eventpoll.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 347da3f4f5d3..6a0c2591e57e 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -1637,6 +1637,8 @@ static __poll_t ep_send_events_proc(struct eventpoll *ep, struct list_head *head * Items cannot vanish during the loop because ep_scan_ready_list() is * holding "mtx" during this call. */ + lockdep_assert_held(&ep->mtx); + list_for_each_entry_safe(epi, tmp, head, rdllink) { if (esed->res >= esed->maxevents) break;