Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp405790pxb; Wed, 11 Nov 2020 06:42:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJwsPDdVWweNpgDfySRGBnDgQexpjKhxszhJfOSVHBGW2sHgSyzBFy+dQoJVg+hOW5oq/NN5 X-Received: by 2002:a17:906:3782:: with SMTP id n2mr25989185ejc.493.1605105745680; Wed, 11 Nov 2020 06:42:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605105745; cv=none; d=google.com; s=arc-20160816; b=xgV6EJJquayzS9C/MNnWUHuBKIB4wfMQmDVV/BUzFNi33iKg+7jc7boaMk1KGxVUJM RdOmsVoJ1H0k9+72WOSOmp336yvD/WdmzD0xIuxkoE+J1v90KtycNUBXxvB7ypSN3a2D DSXrlIjEdW6SX8j5HTtDzUaCY0R9tyhhA79Ead70/OU8YKoghDGlrMqX9iiVIIln8Wxk AzxierFrqKf7V7FI602xYv5Soq580PL5wQTy7vUA2K7KGEkhXBdLE6oDV2MEIM2kMqjh roI82oz5DogV2ymskGtQp57tSFlbbl2OuNWpCofXV8w/znZ4mAFmCZQGSSJOehqkSGJ5 ySYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=iAsOWJH+dkXUTzaqhBrlgo5eO6sziQZv8zrzxA/EoHY=; b=tV1ZSvGHEXM9LeTRyXtA7RrouTHl5ZYi+2KjggPPdN2xd6Bi5kW4GTYS5NfkCoX8K1 8IDmMqFOiOnN3cqjtI/3Lx+PiVoGE8nOaWBfJQYRaiLGhQqPRBPFnLbMFkZ3vG3+XuPj 0PEt+bRwD1htE9q1vJeRF9LUjfQa8xjwdi41yCjMWHhwZ+D/a4ffFQs9fStHpkBTUpEZ wl/MB95j3ABPBBtdKoFOQHjxQIHr5Xzgaby55LnCKD/EEmtquHjDycDB+0QfQkviHR7c ZqF7WS/XxvO7E6GzsbX6wkVb3oOcKFNpIKP7L7qQqC9HHpQBuDWKCVxQ8n2pFML4bLAW xljg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 s7si1604904edh.264.2020.11.11.06.42.01; Wed, 11 Nov 2020 06:42:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726788AbgKKOkO (ORCPT + 99 others); Wed, 11 Nov 2020 09:40:14 -0500 Received: from imap2.colo.codethink.co.uk ([78.40.148.184]:59098 "EHLO imap2.colo.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727307AbgKKOkL (ORCPT ); Wed, 11 Nov 2020 09:40:11 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126] helo=xylophone) by imap2.colo.codethink.co.uk with esmtpsa (Exim 4.92 #3 (Debian)) id 1kcrHb-0003fe-DW; Wed, 11 Nov 2020 14:39:35 +0000 Message-ID: Subject: Re: [PATCH 4.19 19/71] btrfs: extent_io: add proper error handling to lock_extent_buffer_for_io() From: Ben Hutchings To: Pavel Machek , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Qu Wenruo , David Sterba Date: Wed, 11 Nov 2020 14:39:34 +0000 In-Reply-To: <20201111124448.GA26508@amd> References: <20201109125019.906191744@linuxfoundation.org> <20201109125020.811120362@linuxfoundation.org> <20201111124448.GA26508@amd> Organization: Codethink Ltd. Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-11-11 at 13:44 +0100, Pavel Machek wrote: > Hi! > > > Thankfully it's handled by the only caller, btree_write_cache_pages(), > > as later write_one_eb() call will trigger submit_one_bio(). So there > > shouldn't be any problem. > > This explains there should not be any problem in _the > mainline_. AFAICT this talks about this code. Mainline version is: > > prev_eb = eb; > ret = lock_extent_buffer_for_io(eb, &epd); > if (!ret) { > free_extent_buffer(eb); > continue; > } else if (ret < 0) { > done = 1; > free_extent_buffer(eb); > break; > } > > But 4.19 has: > > ret = lock_extent_buffer_for_io(eb, fs_info, &epd); > if (!ret) { > free_extent_buffer(eb); > continue; > } That was changed in mainline two releases after this commit, though. > IOW missing the code mentioned in the changelog. Is 0607eb1d452d4 > prerequisite for this patch? I think it's a separate fix, but probably worth picking too. Ben. > Best regards, > Pavel > > > +/* > > + * Lock eb pages and flush the bio if we can't the locks > > + * > > + * Return 0 if nothing went wrong > > + * Return >0 is same as 0, except bio is not submitted > > + * Return <0 if something went wrong, no page is locked > > + */ -- Ben Hutchings, Software Developer Codethink Ltd https://www.codethink.co.uk/ Dale House, 35 Dale Street Manchester, M1 2HF, United Kingdom