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 7EB0FC6FA99 for ; Mon, 6 Mar 2023 13:40:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230019AbjCFNkX (ORCPT ); Mon, 6 Mar 2023 08:40:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230376AbjCFNkW (ORCPT ); Mon, 6 Mar 2023 08:40:22 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 649E52B2A9 for ; Mon, 6 Mar 2023 05:40:11 -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 dfw.source.kernel.org (Postfix) with ESMTPS id F3F9560F38 for ; Mon, 6 Mar 2023 13:40:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16CE0C433EF; Mon, 6 Mar 2023 13:40:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678110010; bh=NSESegn6IXlsjtWq6fZEIiXnHJwrAxx8VB4Xe5zOdyo=; h=Subject:To:Cc:From:Date:From; b=zimF+GVtV45v7027x1/p12rI++tvoN23y1cYdb8iLbFm9Oa95WXPv5SP6P9Ti7Dq+ 3fzBEDss0GUZIGA/D9c4ZcEwuwmNJ98y6NfCnTHvduESZAGmTF/7cR5cX3l3+VJZB6 s6QZSTgWUJYTw1j5nrWLPl/1sFSDQH/1C8A0jsPU= Subject: FAILED: patch "[PATCH] udf: Fix off-by-one error when discarding preallocation" failed to apply to 6.1-stable tree To: jack@suse.cz Cc: From: Date: Mon, 06 Mar 2023 14:40:05 +0100 Message-ID: <1678110005174144@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 6.1-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y git checkout FETCH_HEAD git cherry-pick -x f54aa97fb7e5329a373f9df4e5e213ced4fc8759 # git commit -s git send-email --to '' --in-reply-to '1678110005174144@kroah.com' --subject-prefix 'PATCH 6.1.y' HEAD^.. Possible dependencies: f54aa97fb7e5 ("udf: Fix off-by-one error when discarding preallocation") f3a30be77750 ("udf: Factor out block mapping into udf_map_block()") a27b2923de7e ("udf: Move udf_expand_dir_adinicb() to its callsite") 57bda9fb169d ("udf: Convert udf_expand_dir_adinicb() to new directory iteration") 16d055656814 ("udf: Discard preallocation before extending file with a hole") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From f54aa97fb7e5329a373f9df4e5e213ced4fc8759 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Mon, 23 Jan 2023 14:29:15 +0100 Subject: [PATCH] udf: Fix off-by-one error when discarding preallocation The condition determining whether the preallocation can be used had an off-by-one error so we didn't discard preallocation when new allocation was just following it. This can then confuse code in inode_getblk(). CC: stable@vger.kernel.org Fixes: 16d055656814 ("udf: Discard preallocation before extending file with a hole") Signed-off-by: Jan Kara diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 51deada8b928..ee440d16411e 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -361,7 +361,7 @@ static int udf_map_block(struct inode *inode, struct udf_map_rq *map) * Block beyond EOF and prealloc extents? Just discard preallocation * as it is not useful and complicates things. */ - if (((loff_t)map->lblk) << inode->i_blkbits > iinfo->i_lenExtents) + if (((loff_t)map->lblk) << inode->i_blkbits >= iinfo->i_lenExtents) udf_discard_prealloc(inode); udf_clear_extent_cache(inode); err = inode_getblk(inode, map);