Commit e600543
NFS: Don't report ENOSPC write errors twice
Any errors reported by the write() system call need to be cleared from
the file descriptor's error tracking. The current call to nfs_wb_all()
causes the error to be reported, but since it doesn't call
file_check_and_advance_wb_err(), we can end up reporting the same error
a second time when the application calls fsync().
Note that since Linux 4.13, the rule is that EIO may be reported for
write(), but it must be reported by a subsequent fsync(), so let's just
drop reporting it in write.
The check for nfs_ctx_key_to_expire() is just a duplicate to the one
already in nfs_write_end(), so let's drop that too.
Reported-by: ChenXiaoSong <chenxiaosong2@huawei.com>
Fixes: ce36853 ("nfs: nfs_file_write() should check for writeback errors")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>1 parent 9641d9b commit e600543
1 file changed
Lines changed: 14 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
598 | 598 | | |
599 | 599 | | |
600 | 600 | | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | 601 | | |
614 | 602 | | |
615 | 603 | | |
| |||
637 | 625 | | |
638 | 626 | | |
639 | 627 | | |
640 | | - | |
| 628 | + | |
641 | 629 | | |
642 | 630 | | |
643 | 631 | | |
| |||
656 | 644 | | |
657 | 645 | | |
658 | 646 | | |
| 647 | + | |
659 | 648 | | |
660 | 649 | | |
661 | 650 | | |
| |||
673 | 662 | | |
674 | 663 | | |
675 | 664 | | |
676 | | - | |
| 665 | + | |
677 | 666 | | |
| 667 | + | |
678 | 668 | | |
679 | 669 | | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
684 | 680 | | |
685 | | - | |
686 | | - | |
687 | 681 | | |
688 | 682 | | |
689 | 683 | | |
| |||
0 commit comments