diff mbox series

iomap: Fix unsharing of an extent >2GB on a 32-bit machine

Message ID 20200607103536.26508-1-willy@infradead.org (mailing list archive)
State New, archived
Headers show
Series iomap: Fix unsharing of an extent >2GB on a 32-bit machine | expand

Commit Message

Matthew Wilcox (Oracle) June 7, 2020, 10:35 a.m. UTC
From: "Matthew Wilcox (Oracle)" <willy@infradead.org>

Widen the type used for counting the number of bytes unshared.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/iomap/buffered-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christoph Hellwig June 8, 2020, 6:20 a.m. UTC | #1
On Sun, Jun 07, 2020 at 03:35:36AM -0700, Matthew Wilcox wrote:
> From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
> 
> Widen the type used for counting the number of bytes unshared.

Looks good, although at least for XFS we can't have that large
extents anyway:

Reviewed-by: Christoph Hellwig <hch@lst.de>
Darrick J. Wong June 8, 2020, 4:16 p.m. UTC | #2
On Sun, Jun 07, 2020 at 03:35:36AM -0700, Matthew Wilcox wrote:
> From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
> 
> Widen the type used for counting the number of bytes unshared.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Makes sense,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  fs/iomap/buffered-io.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index ae6c5e38f0e8..9f90d2394535 100644
> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -909,7 +909,7 @@ iomap_unshare_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
>  		struct iomap *iomap, struct iomap *srcmap)
>  {
>  	long status = 0;
> -	ssize_t written = 0;
> +	loff_t written = 0;
>  
>  	/* don't bother with blocks that are not shared to start with */
>  	if (!(iomap->flags & IOMAP_F_SHARED))
> -- 
> 2.26.2
>
diff mbox series

Patch

diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index ae6c5e38f0e8..9f90d2394535 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -909,7 +909,7 @@  iomap_unshare_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
 		struct iomap *iomap, struct iomap *srcmap)
 {
 	long status = 0;
-	ssize_t written = 0;
+	loff_t written = 0;
 
 	/* don't bother with blocks that are not shared to start with */
 	if (!(iomap->flags & IOMAP_F_SHARED))