From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B87AB6FBB for ; Tue, 10 Jan 2023 18:12:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E913C433D2; Tue, 10 Jan 2023 18:12:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673374361; bh=zlkQeW0j/joRxquS61ZaE9dXO4i0jwb0Iajw7tswj5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tNnRC3FGWLsZv5CeCex4U+hwzkjKPicvRa/1M4w3PsdRdej8vXglQ+8RsArGc0E/6 2PW8HMn3kJ72Azx7caeV8NLTWf/aub3k7rKHACMJO62eZt1qkcA256vSZ83bk5FfE5 3JCaCcPsNHpJoOblCGTk21RIvH5s+bBK3kBhoAQo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jan Kara , Sasha Levin Subject: [PATCH 6.0 101/148] udf: Fix extension of the last extent in the file Date: Tue, 10 Jan 2023 19:03:25 +0100 Message-Id: <20230110180020.394592601@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230110180017.145591678@linuxfoundation.org> References: <20230110180017.145591678@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 b9a83820e1ad..3c380140515d 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -600,7 +600,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