Skip to content

Commit 062e809

Browse files
Matthew Wilcox (Oracle)brauner
authored andcommitted
orangefs: Do not truncate file size
'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)" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Tested-by: Mike Marshall <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 2014c95 commit 062e809

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

fs/orangefs/inode.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ static int orangefs_writepage_locked(struct page *page,
2323
struct orangefs_write_range *wr = NULL;
2424
struct iov_iter iter;
2525
struct bio_vec bv;
26-
size_t len, wlen;
26+
size_t wlen;
2727
ssize_t ret;
28-
loff_t off;
28+
loff_t len, off;
2929

3030
set_page_writeback(page);
3131

@@ -91,8 +91,7 @@ static int orangefs_writepages_work(struct orangefs_writepages *ow,
9191
struct orangefs_write_range *wrp, wr;
9292
struct iov_iter iter;
9393
ssize_t ret;
94-
size_t len;
95-
loff_t off;
94+
loff_t len, off;
9695
int i;
9796

9897
len = i_size_read(inode);

0 commit comments

Comments
 (0)