Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3211787ybl; Mon, 20 Jan 2020 18:37:08 -0800 (PST) X-Google-Smtp-Source: APXvYqyZp0TDcTwvbg65T8YnTgPyd7CzvR0uXqdADHkGipJg667MRLM8fqduevs027gbfSXM2elc X-Received: by 2002:aca:3241:: with SMTP id y62mr1405212oiy.31.1579574228325; Mon, 20 Jan 2020 18:37:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579574228; cv=none; d=google.com; s=arc-20160816; b=PslRFsEC9Pi7TMpYAcX+6v6GSIDixMn+detiKG1+eI82KNcyjkqg7aVaD11QAB3GvL 3VHBFd26Ipqjqp4TZuZSh43jQVv+MrtfmMkiJmrUgA+/t3e21CothkkaSgesGbmkAF5t nwo4nVqZgQcxYj7jHXWxpGqsgjDUlSLSCf3sl658wnMiPh+ADABbePqQ6tZ/W62LEiE+ 1VSG6itxepPIScnq6PFTGiuhnj4r2G/VXW/tJflsWbNhqx7N4TM9rHK1lR82iP+ZNxJA Uu/an9p7k0lP4j8YVhS0XthAg4o3OH/qEhU+lMwvAv1+1id3O6mAOQLKpdP9daaPg46m DMsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type :content-language:thread-index:content-transfer-encoding :mime-version:message-id:date:subject:in-reply-to:cc:to:from :dkim-signature:dkim-filter; bh=ytyuKC3Vaj3EpWIHdeU7Z8cdnKoV6N5MeakWV4sXtIk=; b=a7tXxJdrsGmnuoaUhVV0BhQ7WnrWjdsH4//zsKVWa5BL76GOuvdgRaLrFx+7UJpUu2 cxoqH2RYICEeiKKEUenUaakI1r5zK/Cbpx7JchxrPtDTArH7PzV57AGaOBXuyYONt5ph U6edTgKJ1lbBFZP/8k/4gPG2OyOwqtQy8YqZ86RelxiEV2rB5qkBDg/KCKfZ6XSPVPqa QJ5JcApnl3Xs6MXPiHNBmtS3LPrFJb7NKzC+HKgWkzBdNEcG5s2SiKa4kIwuSBMlG7mj +IZxE6obQYkGvyoPAJoxFQ9UIq0qRVatOBj24nUdbBzz9WflHBsiZQCvYXaMtPxWtQ+v 3M+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=VJIt6MyK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s3si19357713oic.108.2020.01.20.18.36.56; Mon, 20 Jan 2020 18:37:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=VJIt6MyK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729076AbgAUCes (ORCPT + 99 others); Mon, 20 Jan 2020 21:34:48 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:22233 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726890AbgAUCer (ORCPT ); Mon, 20 Jan 2020 21:34:47 -0500 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20200121023443epoutp0476a76856d4df29e9848741c6faaa29cb~rxkKgBpdE2285222852epoutp04w for ; Tue, 21 Jan 2020 02:34:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20200121023443epoutp0476a76856d4df29e9848741c6faaa29cb~rxkKgBpdE2285222852epoutp04w DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1579574083; bh=ytyuKC3Vaj3EpWIHdeU7Z8cdnKoV6N5MeakWV4sXtIk=; h=From:To:Cc:In-Reply-To:Subject:Date:References:From; b=VJIt6MyKso2pVx9TnGLfwBsCWnuMLWneCaZeDsj+BL4fC+B2BUjumA4lWKaUqSY9G eN4rH/7ISf52qTzHj4FF3eyDf84hxqdbg7q2L6+XoYmEadmBaQKVksr/luqaSrVLGi 8JELOIkEbkxRRYYaa0tzAoTFeMrOBTm0vVbkYTBE= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20200121023442epcas1p41268305eb429b9922c322b88fcd89f22~rxkJg5a-U0657906579epcas1p46; Tue, 21 Jan 2020 02:34:42 +0000 (GMT) Received: from epsmges1p3.samsung.com (unknown [182.195.40.165]) by epsnrtp3.localdomain (Postfix) with ESMTP id 481t0d5ll4zMqYkZ; Tue, 21 Jan 2020 02:34:41 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p3.samsung.com (Symantec Messaging Gateway) with SMTP id CB.9C.52419.143662E5; Tue, 21 Jan 2020 11:34:41 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200121023441epcas1p2d4bbc0d350fbb1f6cad140b932b1d917~rxkIEjHI30266402664epcas1p23; Tue, 21 Jan 2020 02:34:41 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200121023441epsmtrp11d6e4ae4dfa611f73148564084643db0~rxkIDo2S31841618416epsmtrp1x; Tue, 21 Jan 2020 02:34:41 +0000 (GMT) X-AuditID: b6c32a37-5b7ff7000001ccc3-c5-5e266341338e Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 20.AB.06569.043662E5; Tue, 21 Jan 2020 11:34:41 +0900 (KST) Received: from namjaejeon01 (unknown [10.88.104.63]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200121023440epsmtip11d8a475f58e79ed8dda32c196ed89aab~rxkH3LIIh1939219392epsmtip1X; Tue, 21 Jan 2020 02:34:40 +0000 (GMT) From: "Namjae Jeon" To: "'Al Viro'" Cc: , , , , , , , , "'Namjae Jeon'" In-Reply-To: <20200121014924.GI8904@ZenIV.linux.org.uk> Subject: RE: [PATCH v12 02/13] exfat: add super block operations Date: Tue, 21 Jan 2020 11:34:40 +0900 Message-ID: <005201d5d003$55325960$ff970c20$@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQGweyIxypJzru68cwvOK1cQ+ZOFYgKRp5m0AvjvcmoCRBuVtKgAmmug Content-Language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrEJsWRmVeSWpSXmKPExsWy7bCmrq5jslqcQd8XfYu/k46xWzQvXs9m sXL1USaL63dvMVvs2XuSxeLyrjlsFhNP/2ay2PLvCKvFpfcfWCzO/z3O6sDl8fvXJEaPnbPu snvsn7uG3WP3zQY2j74tqxg9Pm+S8zi0/Q2bx6Ynb5kCOKJybDJSE1NSixRS85LzUzLz0m2V vIPjneNNzQwMdQ0tLcyVFPISc1NtlVx8AnTdMnOAjlRSKEvMKQUKBSQWFyvp29kU5ZeWpCpk 5BeX2CqlFqTkFBgaFOgVJ+YWl+al6yXn51oZGhgYmQJVJuRkLD+5lLngBG/F40s/mBoYm7m7 GDk5JARMJPbOucvaxcjFISSwg1HizNUNbF2MHEDOJ0aJlz4Q8W+MEtO/TWSEaZjRvoAFIrGX UeLjyi9Q3S8ZJf79uccKUsUmoAtk72cDsUUENCX+z53ADFLELPCbUaJpcwMTSIJTwFxi+rpL 7CC2sICDxO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ocXLmExaQI5gF9CTa NjKChJkF5CW2v53DDHGngsTPp8tYIW5wk/j65Ao7RI2IxOzONuYJjMKzkEyahTBpFpJJs5B0 LGBkWcUomVpQnJueW2xYYJSXWq5XnJhbXJqXrpecn7uJERyHWlo7GE+ciD/EKMDBqMTD6zBN NU6INbGsuDL3EKMEB7OSCO+CJqAQb0piZVVqUX58UWlOavEhRmkOFiVxXvn8Y5FCAumJJanZ qakFqUUwWSYOTqkGxrawL4s475l3amy+fXK54HKmdV/fTbhicvHuiW6mtwn9jisvieS5ZV+6 a/yi1vzivRf13/JeqtVbmjeG9doeMwphMJPv05rT03dk6fq/7UYRD84Z7ymdsXzWr6/B5vUT ExcyCmr+k+bmu/pd+m6u5Y7Y4NV91naNb3ffXf5ZiX177WLeRhbl20osxRmJhlrMRcWJAAuI uH2/AgAA X-CMS-MailID: 20200121023441epcas1p2d4bbc0d350fbb1f6cad140b932b1d917 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20200121014933epcas1p22c54d6162bca6ebe14715542f034993b References: <20200120124428.17863-1-linkinjeon@gmail.com> <20200120124428.17863-3-linkinjeon@gmail.com> <20200121014924.GI8904@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > +static void exfat_put_super(struct super_block *sb) { > > + struct exfat_sb_info *sbi = EXFAT_SB(sb); > > + > > + mutex_lock(&sbi->s_lock); > > + if (test_and_clear_bit(EXFAT_SB_DIRTY, &sbi->s_state)) > > + sync_blockdev(sb->s_bdev); > > + exfat_set_vol_flags(sb, VOL_CLEAN); > > + exfat_free_upcase_table(sb); > > + exfat_free_bitmap(sb); > > + mutex_unlock(&sbi->s_lock); > > + > > + if (sbi->nls_io) { > > + unload_nls(sbi->nls_io); > > + sbi->nls_io = NULL; > > + } > > + exfat_free_iocharset(sbi); > > + sb->s_fs_info = NULL; > > + kfree(sbi); > > +} > > You need to RCU-delay freeing sbi and zeroing ->nls_io. *Everything* used > by ->d_compare() and ->d_hash() needs that treatment. RCU-mode pathwalk > can stray into a filesystem that has already been lazy-umounted and is > just one close() away from shutdown. It's OK, as long as you make sure > that all structures used in methods that could be called in RCU mode (- > >d_compare(), ->d_hash(), rcu-case ->d_revalidate(), rcu-case - > >permission()) have destruction RCU-delayed. Look at what VFAT is doing; > that's precisely the reason for that delayed_free() thing in there. Okay. > > > +static void exfat_destroy_inode(struct inode *inode) { > > + kmem_cache_free(exfat_inode_cachep, EXFAT_I(inode)); } > > No. Again, that MUST be RCU-delayed; either put an explicit > call_rcu() here, or leave as-is, but make that ->free_inode(). Okay. > > > +static void __exit exit_exfat_fs(void) { > > + kmem_cache_destroy(exfat_inode_cachep); > > + unregister_filesystem(&exfat_fs_type); > > ... and add rcu_barrier() here. Okay, I will fix them on next version. Thanks for review!! > > > + exfat_cache_shutdown();