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 95391276057; Tue, 27 May 2025 16:56:14 +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=1748364974; cv=none; b=jAKHYhdeTAdPSAdSwtCQZ2o0qgFQqa9WTF01zu5wQ4gGjoc8lkmpTTNzq3JnYW3W6eMMn9dBIWpU1L2y4JY4x+D0/dqjI2vDgiAdzYk/hZ9O5Sd/VAR/cDF8xN5DDvzIIdytYEcBTsfIsGWbu9yEUinPGVp7i2UHDhbde4qOHUg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748364974; c=relaxed/simple; bh=t2UlPNCj2molpskY1trhZtCeQ7SQQEpfoURMngYPR9k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nzKtUlPtr/paXFCBCfg8RVevc7sFmIbLpCC8Nx+Ae6izeTOKaHPuvxEnCHiCuUH2m0X+K0nc6ESOsgjuR38hPZeO1sdrblHzo1l9oRSh9z4zQJyJFq004VN38THM/+tc9Owu8Qawq6KiwYBpyuk/PRNmrsr/3Qp/KMswHkjznOg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CxdmYhXG; 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="CxdmYhXG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7758C4CEE9; Tue, 27 May 2025 16:56:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748364974; bh=t2UlPNCj2molpskY1trhZtCeQ7SQQEpfoURMngYPR9k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CxdmYhXG5s0dyjTV4v9uE2vxav+Oko7u6xcfNFFuH5As26hqRqQztYe5UylxIW+Dq JhjsqYULZakPOirTBX9h3rN7h7vmRQ6gD5DHkNWOS8Oiv1qsAMR+xJcLfMgl5LJzs1 b6EdaEgObvdo0YIqIfuTAtedMd0p5f01ENKkU36I= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Matthew Wilcox (Oracle)" , Mike Marshall , Christian Brauner , Sasha Levin Subject: [PATCH 6.12 227/626] orangefs: Do not truncate file size Date: Tue, 27 May 2025 18:22:00 +0200 Message-ID: <20250527162454.245694116@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250527162445.028718347@linuxfoundation.org> References: <20250527162445.028718347@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.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Matthew Wilcox (Oracle) [ Upstream commit 062e8093592fb866b8e016641a8b27feb6ac509d ] 'len' is used to store the result of i_size_read(), so making 'len' a size_t results in truncation to 4GiB on 32-bit systems. Signed-off-by: "Matthew Wilcox (Oracle)" Link: https://lore.kernel.org/r/20250305204734.1475264-2-willy@infradead.org Tested-by: Mike Marshall Signed-off-by: Christian Brauner Signed-off-by: Sasha Levin --- fs/orangefs/inode.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c index aae6d2b8767df..63d7c1ca0dfd3 100644 --- a/fs/orangefs/inode.c +++ b/fs/orangefs/inode.c @@ -23,9 +23,9 @@ static int orangefs_writepage_locked(struct page *page, struct orangefs_write_range *wr = NULL; struct iov_iter iter; struct bio_vec bv; - size_t len, wlen; + size_t wlen; ssize_t ret; - loff_t off; + loff_t len, off; set_page_writeback(page); @@ -91,8 +91,7 @@ static int orangefs_writepages_work(struct orangefs_writepages *ow, struct orangefs_write_range *wrp, wr; struct iov_iter iter; ssize_t ret; - size_t len; - loff_t off; + loff_t len, off; int i; len = i_size_read(inode); -- 2.39.5