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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B607C46467 for ; Mon, 16 Jan 2023 16:47:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233496AbjAPQq6 (ORCPT ); Mon, 16 Jan 2023 11:46:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233714AbjAPQqQ (ORCPT ); Mon, 16 Jan 2023 11:46:16 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35531301BD for ; Mon, 16 Jan 2023 08:34:14 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EA88CB8105D for ; Mon, 16 Jan 2023 16:34:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43E93C433F1; Mon, 16 Jan 2023 16:34:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673886851; bh=vx3afFf7OWBvUZ/qmQOxNjs5jwaUzthKlK0JAsJ/m/E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A95TAvRW+d00Fw3mdCZnOoXpOczQbOp5TaChgFGeVaM4XBK9QKjiF7ki7HaCrBiSj oda1OXsC83kZlykYt5xBnE8AcEUCc8/r9d+4oK/Ktm8ctDOWq+dxFdhiKfM+noRgFS jp4HgGsexbW3QOLDgX4AXvkLOFyJMq9BDXvbz43A= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jan Kara , Sasha Levin Subject: [PATCH 5.4 587/658] udf: Fix extension of the last extent in the file Date: Mon, 16 Jan 2023 16:51:15 +0100 Message-Id: <20230116154936.347945003@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116154909.645460653@linuxfoundation.org> References: <20230116154909.645460653@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jan Kara [ Upstream commit 83c7423d1eb6806d13c521d1002cc1a012111719 ] When extending the last extent in the file within the last block, we wrongly computed the length of the last extent. This is mostly a cosmetical problem since the extent does not contain any data and the length will be fixed up by following operations but still. Fixes: 1f3868f06855 ("udf: Fix extending file within last block") Signed-off-by: Jan Kara Signed-off-by: Sasha Levin --- fs/udf/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/udf/inode.c b/fs/udf/inode.c index f6bbf395ce07..37a6bbd5a19c 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -602,7 +602,7 @@ static void udf_do_extend_final_block(struct inode *inode, */ if (new_elen <= (last_ext->extLength & UDF_EXTENT_LENGTH_MASK)) return; - added_bytes = (last_ext->extLength & UDF_EXTENT_LENGTH_MASK) - new_elen; + added_bytes = new_elen - (last_ext->extLength & UDF_EXTENT_LENGTH_MASK); last_ext->extLength += added_bytes; UDF_I(inode)->i_lenExtents += added_bytes; -- 2.35.1