Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2632158pxj; Mon, 14 Jun 2021 03:33:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxXCxdFCsQpUA6JMEqGhbR7yQh8yCSM3TeUWqTa7Np3itVxuXxmiYbIPia4yo2SjaLewXR X-Received: by 2002:a17:906:2a8e:: with SMTP id l14mr14343274eje.549.1623666818345; Mon, 14 Jun 2021 03:33:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623666818; cv=none; d=google.com; s=arc-20160816; b=UqbT9RGfwLDMX2j8rTUzXmv3bO18jABiYv8KulglNGvbCEK0p/GFovVFQKQwzcY142 Rt/0Syn3p+6qRSam8YWpX5ZRU5BmxQLue4OIe/i95XebHq1b0XbpqL3f9a7LKPlpgf/+ +e997zT3yRmtBjSm2tWEW0Oxsdd+tHTTmJlYIwb1jNYIwSO9l7K2oSzngue2N9XO85bc wX8lY/Of8UVfqtP60bVskqohhMUmduXKyVngsj8uF6B44pacLek4le+Noj6fZ9a4EV8r tLXzRBWjbAnQeH2yMlOUs+qf+5Dyo3nLaDx4IgMFPeVs/L7CkealJN8mpR5xOb8eOo/J Z2LQ== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iQpIbu14YIV6GlPQHKOF9W5cekjwMdTOT+Kyr6JD+Gw=; b=fyFZ+KXG/8QDQGKIqCxAJyNFr1syPr7jFTIpdp/lJwuzu01E/+6lwYxQrQP8GxaMyu 6iUGmzGqlKwPBMOkP2/GzKb7T9TR4656BiKBXS9tTtLH1dOvqTHHLJ6fEXoQcyBkrbrP MBwZyGl0HI4BsMdHxivs8lRMqosqrdE+Mb92HM7KP5qzRoGNxnkVzURuwVtf1HSj5yK1 aSi1t5nm4eQBEPo0GrIcRI3NBOxPxioUWbrR4kLZas2bBXDr02F9UuCyvL8wVnpZwPI6 GGdLLDJhoDoiN7HjsJo0OX2LH5mgffYss6TqoT7sF3IUzvfdUQsvzkXyvrGfF/btXggy RMEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VzvvKqXH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c17si2683079ejc.223.2021.06.14.03.33.16; Mon, 14 Jun 2021 03:33:38 -0700 (PDT) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VzvvKqXH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233132AbhFNKd0 (ORCPT + 99 others); Mon, 14 Jun 2021 06:33:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:38348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233036AbhFNKcK (ORCPT ); Mon, 14 Jun 2021 06:32:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 13549611C1; Mon, 14 Jun 2021 10:30:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623666607; bh=XQXLBCcqiSuZEFJCjokN1TxGhtqBeRt8WXewSUo4XHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VzvvKqXHU8jtoyI/YDaJsRx4sieu7iHWSMdz0kukEfx8/Sn9ltz2Witz6A0BZDaVk uOqgu6lMKb9+p14Dx9feY0NZQPeSyiCb22IHf030UurhqMz7LYLFD24Xi0iQFIP1lj VlUmUpxRCSbFwHAuCfVku3riyiUV4YeCcXY5KcYE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ritesh Harjani , David Sterba Subject: [PATCH 4.4 20/34] btrfs: return value from btrfs_mark_extent_written() in case of error Date: Mon, 14 Jun 2021 12:27:11 +0200 Message-Id: <20210614102642.235678579@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210614102641.582612289@linuxfoundation.org> References: <20210614102641.582612289@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ritesh Harjani commit e7b2ec3d3d4ebeb4cff7ae45cf430182fa6a49fb upstream. We always return 0 even in case of an error in btrfs_mark_extent_written(). Fix it to return proper error value in case of a failure. All callers handle it. CC: stable@vger.kernel.org # 4.4+ Signed-off-by: Ritesh Harjani Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1089,7 +1089,7 @@ int btrfs_mark_extent_written(struct btr int del_nr = 0; int del_slot = 0; int recow; - int ret; + int ret = 0; u64 ino = btrfs_ino(inode); path = btrfs_alloc_path(); @@ -1284,7 +1284,7 @@ again: } out: btrfs_free_path(path); - return 0; + return ret; } /*