From patchwork Tue Mar 28 16:13:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 9650169 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1FBA0601E9 for ; Tue, 28 Mar 2017 16:13:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1207C28403 for ; Tue, 28 Mar 2017 16:13:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06D7428414; Tue, 28 Mar 2017 16:13:54 +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=-6.9 required=2.0 tests=BAYES_00,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 B01E628403 for ; Tue, 28 Mar 2017 16:13:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755084AbdC1QNw (ORCPT ); Tue, 28 Mar 2017 12:13:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:52889 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755048AbdC1QNu (ORCPT ); Tue, 28 Mar 2017 12:13:50 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 1F46BAD7A; Tue, 28 Mar 2017 16:13:38 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 1A0B71E125B; Tue, 28 Mar 2017 18:13:35 +0200 (CEST) From: Jan Kara To: Cc: Miklos Szeredi , Amir Goldstein , Paul Moore , Jan Kara Subject: [PATCH 15/33] fsnotify: Remove useless list deletion and comment Date: Tue, 28 Mar 2017 18:13:14 +0200 Message-Id: <20170328161332.29736-16-jack@suse.cz> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170328161332.29736-1-jack@suse.cz> References: <20170328161332.29736-1-jack@suse.cz> 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 After removing all the indirection it is clear that hlist_del_init_rcu(&mark->obj_list); in fsnotify_destroy_marks() is not needed as the mark gets removed from the list shortly afterwards in fsnotify_destroy_mark() -> fsnotify_detach_mark() -> fsnotify_detach_from_object(). Also there is no problem with mark being visible on object list while we call fsnotify_destroy_mark() as parallel destruction of marks from several places is properly handled (as mentioned in the comment in fsnotify_destroy_marks(). So just remove the list removal and also the stale comment. Reviewed-by: Amir Goldstein Signed-off-by: Jan Kara --- fs/notify/mark.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/fs/notify/mark.c b/fs/notify/mark.c index 509bb17f1a7e..462d068e77f0 100644 --- a/fs/notify/mark.c +++ b/fs/notify/mark.c @@ -621,12 +621,6 @@ void fsnotify_destroy_marks(struct fsnotify_mark_connector *conn) } mark = hlist_entry(conn->list.first, struct fsnotify_mark, obj_list); - /* - * We don't update i_fsnotify_mask / mnt_fsnotify_mask here - * since inode / mount is going away anyway. So just remove - * mark from the list. - */ - hlist_del_init_rcu(&mark->obj_list); fsnotify_get_mark(mark); spin_unlock(lock); fsnotify_destroy_mark(mark, mark->group);