Return-Path: Received: from mail-wm0-f47.google.com ([74.125.82.47]:37816 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932692AbcITQ7q (ORCPT ); Tue, 20 Sep 2016 12:59:46 -0400 Received: by mail-wm0-f47.google.com with SMTP id b130so45655014wmc.0 for ; Tue, 20 Sep 2016 09:59:46 -0700 (PDT) To: Jan Kara Cc: linux-fsdevel@vger.kernel.org, Lino Sanfilippo , Guenter Roeck , Andrew Morton From: Heiner Kallweit Subject: Remark on commit a7900a116803 "fsnotify-convert-notification_mutex-to-a-spinlock-fix" Message-ID: <4f06a772-b22c-6ef1-6778-bf9a0d49452b@gmail.com> Date: Tue, 20 Sep 2016 18:59:35 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: I was also hit by the false BUG_ON in the first version of the change and checked how to fix it. The current fix IMHO is overly complex. You could simply use assert_spin_locked(lock). It does exactly what you want and it's even used in other places under fs/notify already. Rgds, Heiner