Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2658462pxj; Mon, 14 Jun 2021 04:14:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2VAWUN0po24mfVGMnP5o8avtBtk70kn4HKKXngIzdBSl/kQQFsUba7Gsmz/q6ae5ARqIK X-Received: by 2002:a17:907:abc:: with SMTP id bz28mr14845876ejc.446.1623669246775; Mon, 14 Jun 2021 04:14:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623669246; cv=none; d=google.com; s=arc-20160816; b=MQSGElZ1y7nO87G1jJJw/HS4K++JVD44Nw2JWoIvhRVgiJUsELet2Z9YHnZc5F2h5C li5UExPvFIvNPBMTZVl4q/lktVaCV909E07SZmPKBJimwywuSJL/oxBw3ECWOzGNImxa a9fA/8Z2mdHrEQ4LMmvLlO80XV2W2jJCsGiTfvJ6nYfN8je0OPT2ycH2e15VVbn4vu/Y NU5ItKCOTjjd3yFok/Mg6MAdA/S2OlVesvzv3HPnA5PubW+1leQ5vxunQu3GuCGY0rHn j/+n8XYSewyFtywkj0nMe+7KeWPmducc0q30eQ5NBfMo2jTqp9J83VOtGBYzrcsO/sNJ g6PQ== 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=NjVmGPeIkBUeELkxMeJni1Goq+gx0rzNuOdBsQiSfLU=; b=c0N0fGicq39vVoXRgEeT0w60IT2Y/EB/sfh23LmDJzFcVKsOsauKCdE/VvameEQxp6 c68aGtIKAvstn+lAbcHDrOvGnfc2CZKTJSAuz0a9zGHF0PbkLWRocDobSMpL1NzozzbN NKlNUV5RMO8yMHKAygbToWVcpMP7XIAVO/J7NHoszx4md5JtMVrcawXwvoaFKKWXR67g Z4lBU27bAyLSkVhIGJPzbjGHofbFiCFtMMlZPfmpf+haoilaRTpnfegIJ0cOXDqwTORf m+LsESQ0iF+0C6XtvhQN04t0VbjkKAUh6V0/yEY+waln0PAM9DGhwsAbiWfT+rm7VH2o 2OBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="LRl/UAUJ"; 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 rv25si11274473ejb.507.2021.06.14.04.13.43; Mon, 14 Jun 2021 04:14:06 -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="LRl/UAUJ"; 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 S235369AbhFNLNt (ORCPT + 99 others); Mon, 14 Jun 2021 07:13:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:36346 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234360AbhFNLBi (ORCPT ); Mon, 14 Jun 2021 07:01:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 57E6C6143E; Mon, 14 Jun 2021 10:43:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623667413; bh=4uv8N9lhtrkqKTPB+5fGHqNcfnV7cisT2iBXTyWqCvI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LRl/UAUJCpcRMF2TvXkZFnmdBpjZXwjJwMP48BHjTBB0m1pcre8WtVx2Ecx1mvpz6 jCDZuA88KAPFejaNVuvQw7wHF4gP74eSNoARKP8ZD1MrYgshX6Xk0y6FSh15QHr8K4 m64deKTNyL6JWgZkf5FeftS6aXb57zFg9Pda5VL0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ritesh Harjani , David Sterba Subject: [PATCH 5.10 061/131] btrfs: return value from btrfs_mark_extent_written() in case of error Date: Mon, 14 Jun 2021 12:27:02 +0200 Message-Id: <20210614102655.092817478@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210614102652.964395392@linuxfoundation.org> References: <20210614102652.964395392@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 @@ -1088,7 +1088,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(); @@ -1309,7 +1309,7 @@ again: } out: btrfs_free_path(path); - return 0; + return ret; } /*