Repository navigation
Commit dfbdbf0
zonefs: Fix O_APPEND async write handling
commit ebfd68c upstream.
zonefs updates the size of a sequential zone file inode only on
completion of direct writes. When executing asynchronous append writes
(with a file open with O_APPEND or using RWF_APPEND), the use of the
current inode size in generic_write_checks() to set an iocb offset thus
leads to unaligned write if an application issues an append write
operation with another write already being executed.
Fix this problem by introducing zonefs_write_checks() as a modified
version of generic_write_checks() using the file inode wp_offset for an
append write iocb offset. Also introduce zonefs_write_check_limits() to
replace generic_write_check_limits() call. This zonefs special helper
makes sure that the maximum file limit used is the maximum size of the
file being accessed.
Since zonefs_write_checks() already truncates the iov_iter, the calls
to iov_iter_truncate() in zonefs_file_dio_write() and
zonefs_file_buffered_write() are removed.
Fixes: 8dcc1a9 ("fs: New zonefs file system")
Cc: <stable@vger.kernel.org>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 38c74f2 commit dfbdbf0
1 file changed
Lines changed: 68 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
719 | 719 | | |
720 | 720 | | |
721 | 721 | | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
722 | 784 | | |
723 | 785 | | |
724 | 786 | | |
| |||
736 | 798 | | |
737 | 799 | | |
738 | 800 | | |
739 | | - | |
740 | | - | |
| 801 | + | |
741 | 802 | | |
742 | 803 | | |
743 | 804 | | |
| |||
755 | 816 | | |
756 | 817 | | |
757 | 818 | | |
758 | | - | |
759 | | - | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
760 | 822 | | |
761 | | - | |
762 | | - | |
763 | | - | |
| 823 | + | |
764 | 824 | | |
765 | 825 | | |
766 | 826 | | |
| |||
820 | 880 | | |
821 | 881 | | |
822 | 882 | | |
823 | | - | |
| 883 | + | |
824 | 884 | | |
825 | 885 | | |
826 | 886 | | |
827 | | - | |
828 | | - | |
829 | 887 | | |
830 | 888 | | |
831 | 889 | | |
| |||
0 commit comments