From patchwork Wed Mar 15 10:46: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: 9625253 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 8D24760424 for ; Wed, 15 Mar 2017 10:46:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C53D285F4 for ; Wed, 15 Mar 2017 10:46:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80F7E2860A; Wed, 15 Mar 2017 10:46:56 +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 1F340285F4 for ; Wed, 15 Mar 2017 10:46:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753314AbdCOKqt (ORCPT ); Wed, 15 Mar 2017 06:46:49 -0400 Received: from mx2.suse.de ([195.135.220.15]:36612 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753214AbdCOKqq (ORCPT ); Wed, 15 Mar 2017 06:46:46 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 01995AE0A; Wed, 15 Mar 2017 10:46:42 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id D09D91E1247; Wed, 15 Mar 2017 11:46:39 +0100 (CET) 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: Wed, 15 Mar 2017 11:46:14 +0100 Message-Id: <20170315104632.7037-16-jack@suse.cz> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170315104632.7037-1-jack@suse.cz> References: <20170315104632.7037-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. Signed-off-by: Jan Kara Reviewed-by: Amir Goldstein --- fs/notify/mark.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/fs/notify/mark.c b/fs/notify/mark.c index cbc7149e17a3..a9dc7afe803d 100644 --- a/fs/notify/mark.c +++ b/fs/notify/mark.c @@ -614,12 +614,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);