From patchwork Fri Jan 6 10:43:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 9500549 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 1CED5606B4 for ; Fri, 6 Jan 2017 10:47:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1CD7928473 for ; Fri, 6 Jan 2017 10:47:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 11CB22847C; Fri, 6 Jan 2017 10:47:28 +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 BA21E28473 for ; Fri, 6 Jan 2017 10:47:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S939927AbdAFKrY (ORCPT ); Fri, 6 Jan 2017 05:47:24 -0500 Received: from mx2.suse.de ([195.135.220.15]:39748 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754984AbdAFKoV (ORCPT ); Fri, 6 Jan 2017 05:44:21 -0500 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 11DF7AC6C; Fri, 6 Jan 2017 10:44:09 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 556511E110E; Fri, 6 Jan 2017 11:44:06 +0100 (CET) From: Jan Kara To: linux-fsdevel@vger.kernel.org Cc: Amir Goldstein , Paul Moore , Miklos Szeredi , Jan Kara Subject: [PATCH 05/22] fsnotify: Update comments Date: Fri, 6 Jan 2017 11:43:44 +0100 Message-Id: <20170106104401.5894-6-jack@suse.cz> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170106104401.5894-1-jack@suse.cz> References: <20170106104401.5894-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 Add a comment that lifetime of a notification mark is protected by SRCU and remove a comment about clearing of marks attached to the inode. It is stale and more uptodate version is at fsnotify_destroy_marks() which is the function handling this case. Reviewed-by: Amir Goldstein Signed-off-by: Jan Kara --- fs/notify/mark.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/fs/notify/mark.c b/fs/notify/mark.c index 6043306e8e21..44836e539169 100644 --- a/fs/notify/mark.c +++ b/fs/notify/mark.c @@ -51,7 +51,7 @@ * * LIFETIME: * Inode marks survive between when they are added to an inode and when their - * refcnt==0. + * refcnt==0. Marks are also protected by fsnotify_mark_srcu. * * The inode mark can be cleared for a number of different reasons including: * - The inode is unlinked for the last time. (fsnotify_inode_remove) @@ -61,17 +61,6 @@ * - The fsnotify_group associated with the mark is going away and all such marks * need to be cleaned up. (fsnotify_clear_marks_by_group) * - * Worst case we are given an inode and need to clean up all the marks on that - * inode. We take i_lock and walk the i_fsnotify_marks safely. For each - * mark on the list we take a reference (so the mark can't disappear under us). - * We remove that mark form the inode's list of marks and we add this mark to a - * private list anchored on the stack using i_free_list; we walk i_free_list - * and before we destroy the mark we make sure that we dont race with a - * concurrent destroy_group by getting a ref to the marks group and taking the - * groups mutex. - - * Very similarly for freeing by group, except we use free_g_list. - * * This has the very interesting property of being able to run concurrently with * any (or all) other directions. */