From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEEABC56202 for ; Wed, 25 Nov 2020 16:22:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EA90A2067C for ; Wed, 25 Nov 2020 16:22:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA90A2067C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 356096B0071; Wed, 25 Nov 2020 11:22:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 306016B0075; Wed, 25 Nov 2020 11:22:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1F3D36B0078; Wed, 25 Nov 2020 11:22:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0061.hostedemail.com [216.40.44.61]) by kanga.kvack.org (Postfix) with ESMTP id 03DB96B0071 for ; Wed, 25 Nov 2020 11:22:54 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id C35DA180AD806 for ; Wed, 25 Nov 2020 16:22:54 +0000 (UTC) X-FDA: 77523459468.10.crow87_3e07fa127378 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 7516F16A0DE for ; Wed, 25 Nov 2020 16:22:54 +0000 (UTC) X-HE-Tag: crow87_3e07fa127378 X-Filterd-Recvd-Size: 2265 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Wed, 25 Nov 2020 16:22:53 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 4507168B02; Wed, 25 Nov 2020 17:22:50 +0100 (CET) Date: Wed, 25 Nov 2020 17:22:50 +0100 From: Christoph Hellwig To: Jan Kara Cc: Christoph Hellwig , Jens Axboe , Tejun Heo , Josef Bacik , Konrad Rzeszutek Wilk , Coly Li , Mike Snitzer , Greg Kroah-Hartman , Johannes Thumshirn , dm-devel@redhat.com, Richard Weinberger , Jan Kara , linux-block@vger.kernel.org, xen-devel@lists.xenproject.org, linux-bcache@vger.kernel.org, linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 04/45] fs: simplify freeze_bdev/thaw_bdev Message-ID: <20201125162250.GA795@lst.de> References: <20201124132751.3747337-1-hch@lst.de> <20201124132751.3747337-5-hch@lst.de> <20201125122953.GH16944@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201125122953.GH16944@quack2.suse.cz> User-Agent: Mutt/1.5.17 (2007-11-01) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Nov 25, 2020 at 01:29:53PM +0100, Jan Kara wrote: > > mutex_unlock(&bdev->bd_fsfreeze_mutex); > > - return sb; /* thaw_bdev releases s->s_umount */ > > + return error; /* thaw_bdev releases s->s_umount */ > > The comment about thaw_bdev() seems to be stale? At least I don't see what > it's speaking about... Yes, this comment seems long stale. I think in the very early days we held s_umount on frozen file system, which caused all kinds of problems. > > mutex_unlock(&bdev->bd_fsfreeze_mutex); > > - return error; > > + return 0; > > But we now won't return -EINVAL if this gets called e.g. with > bd_fsfreeze_count == 0, right? Yes. I had tried to drop the return value as all the freeze_bdev calls ignored it. But I had missed the unpaired emergency thaw and put it back and messed this up..