@@ -920,11 +920,11 @@ static int iomap_write_iter(struct iomap_iter *iter, struct iov_iter *i)
920
920
size_t bytes ; /* Bytes to write to folio */
921
921
size_t copied ; /* Bytes copied from user */
922
922
u64 written ; /* Bytes have been written */
923
- loff_t pos = iter -> pos ;
923
+ loff_t pos ;
924
924
925
925
bytes = iov_iter_count (i );
926
926
retry :
927
- offset = pos & (chunk - 1 );
927
+ offset = iter -> pos & (chunk - 1 );
928
928
bytes = min (chunk - offset , bytes );
929
929
status = balance_dirty_pages_ratelimited_flags (mapping ,
930
930
bdp_flags );
@@ -949,13 +949,14 @@ static int iomap_write_iter(struct iomap_iter *iter, struct iov_iter *i)
949
949
break ;
950
950
}
951
951
952
- status = iomap_write_begin (iter , pos , bytes , & folio );
952
+ status = iomap_write_begin (iter , iter -> pos , bytes , & folio );
953
953
if (unlikely (status )) {
954
- iomap_write_failed (iter -> inode , pos , bytes );
954
+ iomap_write_failed (iter -> inode , iter -> pos , bytes );
955
955
break ;
956
956
}
957
957
if (iter -> iomap .flags & IOMAP_F_STALE )
958
958
break ;
959
+ pos = iter -> pos ;
959
960
960
961
offset = offset_in_folio (folio , pos );
961
962
if (bytes > folio_size (folio ) - offset )
@@ -1276,15 +1277,16 @@ static int iomap_unshare_iter(struct iomap_iter *iter)
1276
1277
do {
1277
1278
struct folio * folio ;
1278
1279
size_t offset ;
1279
- loff_t pos = iter -> pos ;
1280
+ loff_t pos ;
1280
1281
bool ret ;
1281
1282
1282
1283
bytes = min_t (u64 , SIZE_MAX , bytes );
1283
- status = iomap_write_begin (iter , pos , bytes , & folio );
1284
+ status = iomap_write_begin (iter , iter -> pos , bytes , & folio );
1284
1285
if (unlikely (status ))
1285
1286
return status ;
1286
1287
if (iomap -> flags & IOMAP_F_STALE )
1287
1288
break ;
1289
+ pos = iter -> pos ;
1288
1290
1289
1291
offset = offset_in_folio (folio , pos );
1290
1292
if (bytes > folio_size (folio ) - offset )
@@ -1351,15 +1353,16 @@ static int iomap_zero_iter(struct iomap_iter *iter, bool *did_zero)
1351
1353
do {
1352
1354
struct folio * folio ;
1353
1355
size_t offset ;
1354
- loff_t pos = iter -> pos ;
1356
+ loff_t pos ;
1355
1357
bool ret ;
1356
1358
1357
1359
bytes = min_t (u64 , SIZE_MAX , bytes );
1358
- status = iomap_write_begin (iter , pos , bytes , & folio );
1360
+ status = iomap_write_begin (iter , iter -> pos , bytes , & folio );
1359
1361
if (status )
1360
1362
return status ;
1361
1363
if (iter -> iomap .flags & IOMAP_F_STALE )
1362
1364
break ;
1365
+ pos = iter -> pos ;
1363
1366
1364
1367
/* warn about zeroing folios beyond eof that won't write back */
1365
1368
WARN_ON_ONCE (folio_pos (folio ) > iter -> inode -> i_size );
0 commit comments