Skip to contentSkip to conversation

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

PATCH In review Matthew Wilcox 3 participants 3 messages Jun 7, 2020 – Jun 8, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

From: "Matthew Wilcox (Oracle)" <[email protected]>

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

---
 fs/iomap/buffered-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/iomap/buffered-io.c +1 -1
index ae6c5e38f0e8..9f90d2394535 100644
@@ -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))
Signature · 1 line
2.26.2
Reviewed-by on v1 1/1
#2 lore raw
In reply to Matthew Wilcox
Quoted 5 lines · Matthew Wilcox

From: "Matthew Wilcox (Oracle)" <[email protected]>

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

Makes sense,

--D

Quoted 20 lines
---
 fs/iomap/buffered-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/iomap/buffered-io.c +1 -1
index ae6c5e38f0e8..9f90d2394535 100644
@@ -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))
Signature · 1 line
2.26.2