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 A6B3B335BA7; Mon, 18 Aug 2025 13:40:39 +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=1755524439; cv=none; b=LBrP6UrV9bHr29+mrNrzNxd0H/KAoAt7eMMA2l0yPqKT0IZlc4AQ2DXfGYZiCNQu13JMJcUslvCO1gO2XQjvVlz6Sbag1aLZ7/e+7ELdQPpf41/VUwdQd+L1gVxfFV2a1vZ6yK62zEYxvLc6DJa557KeJa6bvP5xbvWaD2VLWDQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755524439; c=relaxed/simple; bh=+C1ajYRSVNJXUtTG6LE/lOFcpeaXazyIfzkHojELsGo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jY+ZsvLYeRtOEzDtOKmaL7kkXdMF6bXdJBDdUfsfNLYc1Oq/9xuFFHyrGnMR2yumDJduvH2Vw4sfhMgjEz4iq8CsjsMRDXQqgiFFzcRHZiK9xelf7VomGrwhqn+d/z8E+dW1K/B5Egg3A28Wy0ncQvbcgSnYtYA8RI4Be9Yx/Ss= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0qF1nDCY; 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="0qF1nDCY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 192ACC4CEEB; Mon, 18 Aug 2025 13:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755524439; bh=+C1ajYRSVNJXUtTG6LE/lOFcpeaXazyIfzkHojELsGo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0qF1nDCYUXlFkRW5tubXM1Ro4dXjkMnwK3ARuLW8Q8ElpdCvLXUPDAyhnQQEYwae2 T7hQxk31y6UFFc44/7OvfHVuwZSoOWx1Rf5Pd/OldCiuYNDDoYQnOUVsmSxjR/poTn sX9ptMLEtWGTZv1mq6pq+IWiNIdkjmy8DtgthwaE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Konstantin Evtushenko , Sergey Bashirov , Christoph Hellwig , Trond Myklebust , Sasha Levin Subject: [PATCH 6.15 430/515] pNFS: Handle RPC size limit for layoutcommits Date: Mon, 18 Aug 2025 14:46:56 +0200 Message-ID: <20250818124514.976998559@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250818124458.334548733@linuxfoundation.org> References: <20250818124458.334548733@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sergey Bashirov [ Upstream commit d897d81671bc4615c80f4f3bd5e6b218f59df50c ] When there are too many block extents for a layoutcommit, they may not all fit into the maximum-sized RPC. This patch allows the generic pnfs code to properly handle -ENOSPC returned by the block/scsi layout driver and trigger additional layoutcommits if necessary. Co-developed-by: Konstantin Evtushenko Signed-off-by: Konstantin Evtushenko Signed-off-by: Sergey Bashirov Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20250630183537.196479-5-sergeybashirov@gmail.com Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- fs/nfs/pnfs.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 1a7ec68bde15..3fd0971bf16f 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -3340,6 +3340,7 @@ pnfs_layoutcommit_inode(struct inode *inode, bool sync) struct nfs_inode *nfsi = NFS_I(inode); loff_t end_pos; int status; + bool mark_as_dirty = false; if (!pnfs_layoutcommit_outstanding(inode)) return 0; @@ -3391,19 +3392,23 @@ pnfs_layoutcommit_inode(struct inode *inode, bool sync) if (ld->prepare_layoutcommit) { status = ld->prepare_layoutcommit(&data->args); if (status) { - put_cred(data->cred); + if (status != -ENOSPC) + put_cred(data->cred); spin_lock(&inode->i_lock); set_bit(NFS_INO_LAYOUTCOMMIT, &nfsi->flags); if (end_pos > nfsi->layout->plh_lwb) nfsi->layout->plh_lwb = end_pos; - goto out_unlock; + if (status != -ENOSPC) + goto out_unlock; + spin_unlock(&inode->i_lock); + mark_as_dirty = true; } } status = nfs4_proc_layoutcommit(data, sync); out: - if (status) + if (status || mark_as_dirty) mark_inode_dirty_sync(inode); dprintk("<-- %s status %d\n", __func__, status); return status; -- 2.39.5