@@ -1454,15 +1454,10 @@ vm_fault_t iomap_page_mkwrite(struct vm_fault *vmf, const struct iomap_ops *ops)
1454
1454
EXPORT_SYMBOL_GPL (iomap_page_mkwrite );
1455
1455
1456
1456
static void iomap_finish_folio_write (struct inode * inode , struct folio * folio ,
1457
- size_t len , int error )
1457
+ size_t len )
1458
1458
{
1459
1459
struct iomap_folio_state * ifs = folio -> private ;
1460
1460
1461
- if (error ) {
1462
- folio_set_error (folio );
1463
- mapping_set_error (inode -> i_mapping , error );
1464
- }
1465
-
1466
1461
WARN_ON_ONCE (i_blocks_per_folio (inode , folio ) > 1 && !ifs );
1467
1462
WARN_ON_ONCE (ifs && atomic_read (& ifs -> write_bytes_pending ) <= 0 );
1468
1463
@@ -1483,18 +1478,24 @@ iomap_finish_ioend(struct iomap_ioend *ioend, int error)
1483
1478
struct folio_iter fi ;
1484
1479
u32 folio_count = 0 ;
1485
1480
1481
+ if (error ) {
1482
+ mapping_set_error (inode -> i_mapping , error );
1483
+ if (!bio_flagged (bio , BIO_QUIET )) {
1484
+ pr_err_ratelimited (
1485
+ "%s: writeback error on inode %lu, offset %lld, sector %llu" ,
1486
+ inode -> i_sb -> s_id , inode -> i_ino ,
1487
+ ioend -> io_offset , ioend -> io_sector );
1488
+ }
1489
+ }
1490
+
1486
1491
/* walk all folios in bio, ending page IO on them */
1487
1492
bio_for_each_folio_all (fi , bio ) {
1488
- iomap_finish_folio_write (inode , fi .folio , fi .length , error );
1493
+ if (error )
1494
+ folio_set_error (fi .folio );
1495
+ iomap_finish_folio_write (inode , fi .folio , fi .length );
1489
1496
folio_count ++ ;
1490
1497
}
1491
1498
1492
- if (unlikely (error && !bio_flagged (bio , BIO_QUIET ))) {
1493
- printk_ratelimited (KERN_ERR
1494
- "%s: writeback error on inode %lu, offset %lld, sector %llu" ,
1495
- inode -> i_sb -> s_id , inode -> i_ino ,
1496
- ioend -> io_offset , ioend -> io_sector );
1497
- }
1498
1499
bio_put (bio ); /* frees the ioend */
1499
1500
return folio_count ;
1500
1501
}
0 commit comments