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 ADD0E35A95C; Fri, 9 Jan 2026 12:32:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767961944; cv=none; b=oMFf3/6IVB+mJo9L1F5xsshA926m1d2gmBVdG7MvOEgsSk8Oro7OTZqJW5nQ4vhQw+8v0WAi4vssF+7KKtbn3cEihv1q5seF13pojq5PGVPuqjg9VBr7NWrKlIEib9cwtkVP+aN27fqbbs5BnDS5bAmw1yj7QyuApuSdTeg8tps= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767961944; c=relaxed/simple; bh=bdguDp9SvKWKhWRMfcz3C9h0bkxFVRRyfx2g7TVCoRE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qKKc+WDhpJ01fbyIYgy5vuZAI9iXbnEcMRIgXPYVRud8lfV0aiG5Q79j2lesqDgef+z1RbYg7O/cql48hE6zmapkexS2OZuuv/pf7R48cpvJK1rlmt8UNhCcZli6iGj60iz72B5ol7gx4OXOW1IWkBE028pnkLVfjYpwXzV+tQI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=C4aL/GWl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="C4aL/GWl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B5ECC16AAE; Fri, 9 Jan 2026 12:32:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1767961944; bh=bdguDp9SvKWKhWRMfcz3C9h0bkxFVRRyfx2g7TVCoRE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C4aL/GWlPNo/41TLQM1Uw6bVrQUq+A++v3n3jQo98e20q2P9x9hpGQz+ydqtjLAK+ jqOdBkQwJEEQ/jlK4zIW9fUDFiy51cupv+ztIEkqDqf47pmStE8Lco3N+Dzzg7DoEd FVlT/iauO7Rd0oWDTQ0ZBAnWxwadcFMq16y1h4eU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jonathan Curley , Trond Myklebust , Sasha Levin Subject: [PATCH 6.1 191/634] NFSv4/pNFS: Clear NFS_INO_LAYOUTCOMMIT in pnfs_mark_layout_stateid_invalid Date: Fri, 9 Jan 2026 12:37:49 +0100 Message-ID: <20260109112124.625018451@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260109112117.407257400@linuxfoundation.org> References: <20260109112117.407257400@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jonathan Curley [ Upstream commit e0f8058f2cb56de0b7572f51cd563ca5debce746 ] Fixes a crash when layout is null during this call stack: write_inode -> nfs4_write_inode -> pnfs_layoutcommit_inode pnfs_set_layoutcommit relies on the lseg refcount to keep the layout around. Need to clear NFS_INO_LAYOUTCOMMIT otherwise we might attempt to reference a null layout. Fixes: fe1cf9469d7bc ("pNFS: Clear all layout segment state in pnfs_mark_layout_stateid_invalid") Signed-off-by: Jonathan Curley Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- fs/nfs/pnfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 86f008241c56b..43cd2d6a0836a 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -465,6 +465,7 @@ pnfs_mark_layout_stateid_invalid(struct pnfs_layout_hdr *lo, struct pnfs_layout_segment *lseg, *next; set_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags); + clear_bit(NFS_INO_LAYOUTCOMMIT, &NFS_I(lo->plh_inode)->flags); list_for_each_entry_safe(lseg, next, &lo->plh_segs, pls_list) pnfs_clear_lseg_state(lseg, lseg_list); pnfs_clear_layoutreturn_info(lo); -- 2.51.0