Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp459302ybt; Wed, 17 Jun 2020 05:42:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGaHNoNQi/aTWafCy1ydLRBSpIKUI9ClcCUVIyK3J3YIqPl9pKs1APx0yGB7+sCaDyjE2n X-Received: by 2002:a05:6402:3c2:: with SMTP id t2mr7069041edw.361.1592397772734; Wed, 17 Jun 2020 05:42:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592397772; cv=none; d=google.com; s=arc-20160816; b=kl1rwjv2x+6T3F2VRqiditbmYX9X4QR3mLWMkCb/tlizIn4vPag5p4EKBw08u2ffb3 X2hpBm2G622bMq7PDm/mDslzZaB347xtnm01z5sVsFN4N6kSjd+067dt8E9Cu0hW6hXR 0Wx0J2CLAyYDDjCx/ykIUzlpnj4Zrx9Ox3YvwWW80fW0SXjjQir5aRF2rxtnLr/1PJbX xZMsGLTRn4F5k26ffhmDeLptNITVXyfl4l1d8xaL+QSCkuC7XP/X+ddDO/ijThgrj3o5 dEhpfBTSoQMrqWGwhssws3yzsw7UUChbkyzzJndBiIxf/ElLkV3JfOQvlIdEsanD4K6q RDsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=/kLNvVV/3xX5vxI2vggUdQ6mZbg3ZJUqH11MHJdrpT4=; b=Z0VO9h5DhKwhYBeyE/sA6R35+1feLlual9oljtuv34ibmJmG3a5J1buQSMnLWWV/Jp 6nc33U+mN2Mk7UUkRIqnJAC86Y2ysA8OoHhNJPz7k8iVYeucY72EWvTb2byMostyb2es RwoAGK6ScC1+uSviqBvLHRGgqvRVnEZpzwVCpT+LhcazNJtAVfrm4wgh5X2nADW4jF/V ncPAUvkXT1cPbHoYmVVt3Qe0cfKkMNUmBP96+ahmFBDkP2mPoSIvN0AxLl9LF0rX9TMI uUnsmVKHWd7gvXJpgNo/fT3hBJeZq+C8GGfdzQUQ6sRvEYTnw4NxDQew+ZfygiV0nizg hf2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ar22si13107941ejc.434.2020.06.17.05.42.20; Wed, 17 Jun 2020 05:42:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725941AbgFQMmO (ORCPT + 99 others); Wed, 17 Jun 2020 08:42:14 -0400 Received: from mx2.suse.de ([195.135.220.15]:55436 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbgFQMmA (ORCPT ); Wed, 17 Jun 2020 08:42:00 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CC2CAAAC6; Wed, 17 Jun 2020 12:42:02 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id EF0ED1E128D; Wed, 17 Jun 2020 14:41:57 +0200 (CEST) Date: Wed, 17 Jun 2020 14:41:57 +0200 From: Jan Kara To: "zhangyi (F)" Cc: linux-ext4@vger.kernel.org, tytso@mit.edu, jack@suse.cz, adilger.kernel@dilger.ca, zhangxiaoxu5@huawei.com, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2 3/5] ext4: detect metadata async write error when getting journal's write access Message-ID: <20200617124157.GB29763@quack2.suse.cz> References: <20200617115947.836221-1-yi.zhang@huawei.com> <20200617115947.836221-4-yi.zhang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200617115947.836221-4-yi.zhang@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed 17-06-20 19:59:45, zhangyi (F) wrote: > Although we have already introduce s_bdev_wb_err_work to detect and > handle async write metadata buffer error as soon as possible, there is > still a potential race that could lead to filesystem inconsistency, > which is the buffer may reading and re-writing out to journal before > s_bdev_wb_err_work run. So this patch detect bdev mapping->wb_err when > getting journal's write access and also mark the filesystem error if > something bad happened. > > Signed-off-by: zhangyi (F) So instead of all this, cannot we just do: if (work_pending(sbi->s_bdev_wb_err_work)) flush_work(sbi->s_bdev_wb_err_work); ? And so we are sure the filesystem is aborted if the abort was pending? Honza -- Jan Kara SUSE Labs, CR