tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 8ca5297e7e38f2dc8c753d33a5092e7be181fff0 commit: 0060ef3b4e6dd1410da164d48a595eadb2fb02f7 mm: support THPs in zero_user_segments date: 5 months ago config: powerpc-randconfig-r023-20210430 (attached as .config) compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 8f5a2a5836cc8e4c1def2bdeb022e7b496623439) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install powerpc cross compiling tool for clang build # apt-get install binutils-powerpc-linux-gnu # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0060ef3b4e6dd1410da164d48a595eadb2fb02f7 git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout 0060ef3b4e6dd1410da164d48a595eadb2fb02f7 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=powerpc If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@xxxxxxxxx> All warnings (new ones prefixed by >>): arch/powerpc/include/asm/io-defs.h:45:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] DEF_PCI_AC_NORET(insw, (unsigned long p, void *b, unsigned long c), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET' __do_##name al; \ ^~~~~~~~~~~~~~ <scratch space>:109:1: note: expanded from here __do_insw ^ arch/powerpc/include/asm/io.h:542:56: note: expanded from macro '__do_insw' #define __do_insw(p, b, n) readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n)) ~~~~~~~~~~~~~~~~~~~~~^ In file included from fs/ntfs/file.c:8: In file included from include/linux/backing-dev.h:15: In file included from include/linux/blkdev.h:14: In file included from include/linux/pagemap.h:11: In file included from include/linux/highmem.h:10: In file included from include/linux/hardirq.h:10: In file included from arch/powerpc/include/asm/hardirq.h:6: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:604: arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET' __do_##name al; \ ^~~~~~~~~~~~~~ <scratch space>:113:1: note: expanded from here __do_insl ^ arch/powerpc/include/asm/io.h:543:56: note: expanded from macro '__do_insl' #define __do_insl(p, b, n) readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n)) ~~~~~~~~~~~~~~~~~~~~~^ In file included from fs/ntfs/file.c:8: In file included from include/linux/backing-dev.h:15: In file included from include/linux/blkdev.h:14: In file included from include/linux/pagemap.h:11: In file included from include/linux/highmem.h:10: In file included from include/linux/hardirq.h:10: In file included from arch/powerpc/include/asm/hardirq.h:6: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:604: arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET' __do_##name al; \ ^~~~~~~~~~~~~~ <scratch space>:117:1: note: expanded from here __do_outsb ^ arch/powerpc/include/asm/io.h:544:58: note: expanded from macro '__do_outsb' #define __do_outsb(p, b, n) writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n)) ~~~~~~~~~~~~~~~~~~~~~^ In file included from fs/ntfs/file.c:8: In file included from include/linux/backing-dev.h:15: In file included from include/linux/blkdev.h:14: In file included from include/linux/pagemap.h:11: In file included from include/linux/highmem.h:10: In file included from include/linux/hardirq.h:10: In file included from arch/powerpc/include/asm/hardirq.h:6: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:604: arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET' __do_##name al; \ ^~~~~~~~~~~~~~ <scratch space>:121:1: note: expanded from here __do_outsw ^ arch/powerpc/include/asm/io.h:545:58: note: expanded from macro '__do_outsw' #define __do_outsw(p, b, n) writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n)) ~~~~~~~~~~~~~~~~~~~~~^ In file included from fs/ntfs/file.c:8: In file included from include/linux/backing-dev.h:15: In file included from include/linux/blkdev.h:14: In file included from include/linux/pagemap.h:11: In file included from include/linux/highmem.h:10: In file included from include/linux/hardirq.h:10: In file included from arch/powerpc/include/asm/hardirq.h:6: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:604: arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET' __do_##name al; \ ^~~~~~~~~~~~~~ <scratch space>:125:1: note: expanded from here __do_outsl ^ arch/powerpc/include/asm/io.h:546:58: note: expanded from macro '__do_outsl' #define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n)) ~~~~~~~~~~~~~~~~~~~~~^ >> fs/ntfs/file.c:1727:16: warning: stack frame size of 4064 bytes in function 'ntfs_perform_write' [-Wframe-larger-than=] static ssize_t ntfs_perform_write(struct file *file, struct iov_iter *i, ^ 13 warnings generated. vim +/ntfs_perform_write +1727 fs/ntfs/file.c 9014da7525dffe Marco Stornelli 2012-12-15 1720 98b270362bb9ea Anton Altaparmakov 2005-10-11 1721 /** a632f559304130 Anton Altaparmakov 2015-03-11 1722 * ntfs_perform_write - perform buffered write to a file a632f559304130 Anton Altaparmakov 2015-03-11 1723 * @file: file to write to a632f559304130 Anton Altaparmakov 2015-03-11 1724 * @i: iov_iter with data to write a632f559304130 Anton Altaparmakov 2015-03-11 1725 * @pos: byte offset in file at which to begin writing to 98b270362bb9ea Anton Altaparmakov 2005-10-11 1726 */ a632f559304130 Anton Altaparmakov 2015-03-11 @1727 static ssize_t ntfs_perform_write(struct file *file, struct iov_iter *i, a632f559304130 Anton Altaparmakov 2015-03-11 1728 loff_t pos) 98b270362bb9ea Anton Altaparmakov 2005-10-11 1729 { 98b270362bb9ea Anton Altaparmakov 2005-10-11 1730 struct address_space *mapping = file->f_mapping; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1731 struct inode *vi = mapping->host; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1732 ntfs_inode *ni = NTFS_I(vi); 98b270362bb9ea Anton Altaparmakov 2005-10-11 1733 ntfs_volume *vol = ni->vol; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1734 struct page *pages[NTFS_MAX_PAGES_PER_CLUSTER]; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1735 struct page *cached_page = NULL; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1736 VCN last_vcn; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1737 LCN lcn; a632f559304130 Anton Altaparmakov 2015-03-11 1738 size_t bytes; a632f559304130 Anton Altaparmakov 2015-03-11 1739 ssize_t status, written = 0; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1740 unsigned nr_pages; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1741 a632f559304130 Anton Altaparmakov 2015-03-11 1742 ntfs_debug("Entering for i_ino 0x%lx, attribute type 0x%x, pos " a632f559304130 Anton Altaparmakov 2015-03-11 1743 "0x%llx, count 0x%lx.", vi->i_ino, a632f559304130 Anton Altaparmakov 2015-03-11 1744 (unsigned)le32_to_cpu(ni->type), a632f559304130 Anton Altaparmakov 2015-03-11 1745 (unsigned long long)pos, a632f559304130 Anton Altaparmakov 2015-03-11 1746 (unsigned long)iov_iter_count(i)); 98b270362bb9ea Anton Altaparmakov 2005-10-11 1747 /* 98b270362bb9ea Anton Altaparmakov 2005-10-11 1748 * If a previous ntfs_truncate() failed, repeat it and abort if it 98b270362bb9ea Anton Altaparmakov 2005-10-11 1749 * fails again. 98b270362bb9ea Anton Altaparmakov 2005-10-11 1750 */ 98b270362bb9ea Anton Altaparmakov 2005-10-11 1751 if (unlikely(NInoTruncateFailed(ni))) { a632f559304130 Anton Altaparmakov 2015-03-11 1752 int err; a632f559304130 Anton Altaparmakov 2015-03-11 1753 bd5fe6c5eb9c54 Christoph Hellwig 2011-06-24 1754 inode_dio_wait(vi); 98b270362bb9ea Anton Altaparmakov 2005-10-11 1755 err = ntfs_truncate(vi); 98b270362bb9ea Anton Altaparmakov 2005-10-11 1756 if (err || NInoTruncateFailed(ni)) { 98b270362bb9ea Anton Altaparmakov 2005-10-11 1757 if (!err) 98b270362bb9ea Anton Altaparmakov 2005-10-11 1758 err = -EIO; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1759 ntfs_error(vol->sb, "Cannot perform write to inode " 98b270362bb9ea Anton Altaparmakov 2005-10-11 1760 "0x%lx, attribute type 0x%x, because " 98b270362bb9ea Anton Altaparmakov 2005-10-11 1761 "ntfs_truncate() failed (error code " 98b270362bb9ea Anton Altaparmakov 2005-10-11 1762 "%i).", vi->i_ino, 98b270362bb9ea Anton Altaparmakov 2005-10-11 1763 (unsigned)le32_to_cpu(ni->type), err); 98b270362bb9ea Anton Altaparmakov 2005-10-11 1764 return err; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1765 } 98b270362bb9ea Anton Altaparmakov 2005-10-11 1766 } 98b270362bb9ea Anton Altaparmakov 2005-10-11 1767 /* 98b270362bb9ea Anton Altaparmakov 2005-10-11 1768 * Determine the number of pages per cluster for non-resident 98b270362bb9ea Anton Altaparmakov 2005-10-11 1769 * attributes. 98b270362bb9ea Anton Altaparmakov 2005-10-11 1770 */ 98b270362bb9ea Anton Altaparmakov 2005-10-11 1771 nr_pages = 1; 09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01 1772 if (vol->cluster_size > PAGE_SIZE && NInoNonResident(ni)) 09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01 1773 nr_pages = vol->cluster_size >> PAGE_SHIFT; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1774 last_vcn = -1; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1775 do { 98b270362bb9ea Anton Altaparmakov 2005-10-11 1776 VCN vcn; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1777 pgoff_t idx, start_idx; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1778 unsigned ofs, do_pages, u; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1779 size_t copied; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1780 09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01 1781 start_idx = idx = pos >> PAGE_SHIFT; 09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01 1782 ofs = pos & ~PAGE_MASK; 09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01 1783 bytes = PAGE_SIZE - ofs; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1784 do_pages = 1; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1785 if (nr_pages > 1) { 98b270362bb9ea Anton Altaparmakov 2005-10-11 1786 vcn = pos >> vol->cluster_size_bits; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1787 if (vcn != last_vcn) { 98b270362bb9ea Anton Altaparmakov 2005-10-11 1788 last_vcn = vcn; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1789 /* 98b270362bb9ea Anton Altaparmakov 2005-10-11 1790 * Get the lcn of the vcn the write is in. If 98b270362bb9ea Anton Altaparmakov 2005-10-11 1791 * it is a hole, need to lock down all pages in 98b270362bb9ea Anton Altaparmakov 2005-10-11 1792 * the cluster. 98b270362bb9ea Anton Altaparmakov 2005-10-11 1793 */ 98b270362bb9ea Anton Altaparmakov 2005-10-11 1794 down_read(&ni->runlist.lock); 98b270362bb9ea Anton Altaparmakov 2005-10-11 1795 lcn = ntfs_attr_vcn_to_lcn_nolock(ni, pos >> c49c31115067bc Richard Knutsson 2006-09-30 1796 vol->cluster_size_bits, false); 98b270362bb9ea Anton Altaparmakov 2005-10-11 1797 up_read(&ni->runlist.lock); 98b270362bb9ea Anton Altaparmakov 2005-10-11 1798 if (unlikely(lcn < LCN_HOLE)) { 98b270362bb9ea Anton Altaparmakov 2005-10-11 1799 if (lcn == LCN_ENOMEM) 98b270362bb9ea Anton Altaparmakov 2005-10-11 1800 status = -ENOMEM; a632f559304130 Anton Altaparmakov 2015-03-11 1801 else { a632f559304130 Anton Altaparmakov 2015-03-11 1802 status = -EIO; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1803 ntfs_error(vol->sb, "Cannot " 98b270362bb9ea Anton Altaparmakov 2005-10-11 1804 "perform write to " 98b270362bb9ea Anton Altaparmakov 2005-10-11 1805 "inode 0x%lx, " 98b270362bb9ea Anton Altaparmakov 2005-10-11 1806 "attribute type 0x%x, " 98b270362bb9ea Anton Altaparmakov 2005-10-11 1807 "because the attribute " 98b270362bb9ea Anton Altaparmakov 2005-10-11 1808 "is corrupt.", 98b270362bb9ea Anton Altaparmakov 2005-10-11 1809 vi->i_ino, (unsigned) 98b270362bb9ea Anton Altaparmakov 2005-10-11 1810 le32_to_cpu(ni->type)); a632f559304130 Anton Altaparmakov 2015-03-11 1811 } 98b270362bb9ea Anton Altaparmakov 2005-10-11 1812 break; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1813 } 98b270362bb9ea Anton Altaparmakov 2005-10-11 1814 if (lcn == LCN_HOLE) { 98b270362bb9ea Anton Altaparmakov 2005-10-11 1815 start_idx = (pos & ~(s64) 98b270362bb9ea Anton Altaparmakov 2005-10-11 1816 vol->cluster_size_mask) 09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01 1817 >> PAGE_SHIFT; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1818 bytes = vol->cluster_size - (pos & 98b270362bb9ea Anton Altaparmakov 2005-10-11 1819 vol->cluster_size_mask); 98b270362bb9ea Anton Altaparmakov 2005-10-11 1820 do_pages = nr_pages; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1821 } 98b270362bb9ea Anton Altaparmakov 2005-10-11 1822 } 98b270362bb9ea Anton Altaparmakov 2005-10-11 1823 } a632f559304130 Anton Altaparmakov 2015-03-11 1824 if (bytes > iov_iter_count(i)) a632f559304130 Anton Altaparmakov 2015-03-11 1825 bytes = iov_iter_count(i); a632f559304130 Anton Altaparmakov 2015-03-11 1826 again: 98b270362bb9ea Anton Altaparmakov 2005-10-11 1827 /* 98b270362bb9ea Anton Altaparmakov 2005-10-11 1828 * Bring in the user page(s) that we will copy from _first_. 98b270362bb9ea Anton Altaparmakov 2005-10-11 1829 * Otherwise there is a nasty deadlock on copying from the same 98b270362bb9ea Anton Altaparmakov 2005-10-11 1830 * page(s) as we are writing to, without it/them being marked 98b270362bb9ea Anton Altaparmakov 2005-10-11 1831 * up-to-date. Note, at present there is nothing to stop the 98b270362bb9ea Anton Altaparmakov 2005-10-11 1832 * pages being swapped out between us bringing them into memory 98b270362bb9ea Anton Altaparmakov 2005-10-11 1833 * and doing the actual copying. 98b270362bb9ea Anton Altaparmakov 2005-10-11 1834 */ 4bce9f6ee8f84f Al Viro 2016-09-17 1835 if (unlikely(iov_iter_fault_in_readable(i, bytes))) { a632f559304130 Anton Altaparmakov 2015-03-11 1836 status = -EFAULT; a632f559304130 Anton Altaparmakov 2015-03-11 1837 break; a632f559304130 Anton Altaparmakov 2015-03-11 1838 } 98b270362bb9ea Anton Altaparmakov 2005-10-11 1839 /* Get and lock @do_pages starting at index @start_idx. */ 98b270362bb9ea Anton Altaparmakov 2005-10-11 1840 status = __ntfs_grab_cache_pages(mapping, start_idx, do_pages, 4c99000ac47cbd Minchan Kim 2010-05-24 1841 pages, &cached_page); 98b270362bb9ea Anton Altaparmakov 2005-10-11 1842 if (unlikely(status)) 98b270362bb9ea Anton Altaparmakov 2005-10-11 1843 break; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1844 /* 98b270362bb9ea Anton Altaparmakov 2005-10-11 1845 * For non-resident attributes, we need to fill any holes with 98b270362bb9ea Anton Altaparmakov 2005-10-11 1846 * actual clusters and ensure all bufferes are mapped. We also 98b270362bb9ea Anton Altaparmakov 2005-10-11 1847 * need to bring uptodate any buffers that are only partially 98b270362bb9ea Anton Altaparmakov 2005-10-11 1848 * being written to. 98b270362bb9ea Anton Altaparmakov 2005-10-11 1849 */ 98b270362bb9ea Anton Altaparmakov 2005-10-11 1850 if (NInoNonResident(ni)) { 98b270362bb9ea Anton Altaparmakov 2005-10-11 1851 status = ntfs_prepare_pages_for_non_resident_write( 98b270362bb9ea Anton Altaparmakov 2005-10-11 1852 pages, do_pages, pos, bytes); 98b270362bb9ea Anton Altaparmakov 2005-10-11 1853 if (unlikely(status)) { 98b270362bb9ea Anton Altaparmakov 2005-10-11 1854 do { 98b270362bb9ea Anton Altaparmakov 2005-10-11 1855 unlock_page(pages[--do_pages]); 09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01 1856 put_page(pages[do_pages]); 98b270362bb9ea Anton Altaparmakov 2005-10-11 1857 } while (do_pages); 98b270362bb9ea Anton Altaparmakov 2005-10-11 1858 break; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1859 } 98b270362bb9ea Anton Altaparmakov 2005-10-11 1860 } 09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01 1861 u = (pos >> PAGE_SHIFT) - pages[0]->index; a632f559304130 Anton Altaparmakov 2015-03-11 1862 copied = ntfs_copy_from_user_iter(pages + u, do_pages - u, ofs, a632f559304130 Anton Altaparmakov 2015-03-11 1863 i, bytes); 98b270362bb9ea Anton Altaparmakov 2005-10-11 1864 ntfs_flush_dcache_pages(pages + u, do_pages - u); a632f559304130 Anton Altaparmakov 2015-03-11 1865 status = 0; a632f559304130 Anton Altaparmakov 2015-03-11 1866 if (likely(copied == bytes)) { a632f559304130 Anton Altaparmakov 2015-03-11 1867 status = ntfs_commit_pages_after_write(pages, do_pages, a632f559304130 Anton Altaparmakov 2015-03-11 1868 pos, bytes); a632f559304130 Anton Altaparmakov 2015-03-11 1869 if (!status) a632f559304130 Anton Altaparmakov 2015-03-11 1870 status = bytes; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1871 } 98b270362bb9ea Anton Altaparmakov 2005-10-11 1872 do { 98b270362bb9ea Anton Altaparmakov 2005-10-11 1873 unlock_page(pages[--do_pages]); 09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01 1874 put_page(pages[do_pages]); 98b270362bb9ea Anton Altaparmakov 2005-10-11 1875 } while (do_pages); a632f559304130 Anton Altaparmakov 2015-03-11 1876 if (unlikely(status < 0)) 98b270362bb9ea Anton Altaparmakov 2005-10-11 1877 break; a632f559304130 Anton Altaparmakov 2015-03-11 1878 copied = status; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1879 cond_resched(); a632f559304130 Anton Altaparmakov 2015-03-11 1880 if (unlikely(!copied)) { a632f559304130 Anton Altaparmakov 2015-03-11 1881 size_t sc; a632f559304130 Anton Altaparmakov 2015-03-11 1882 a632f559304130 Anton Altaparmakov 2015-03-11 1883 /* a632f559304130 Anton Altaparmakov 2015-03-11 1884 * We failed to copy anything. Fall back to single a632f559304130 Anton Altaparmakov 2015-03-11 1885 * segment length write. a632f559304130 Anton Altaparmakov 2015-03-11 1886 * a632f559304130 Anton Altaparmakov 2015-03-11 1887 * This is needed to avoid possible livelock in the a632f559304130 Anton Altaparmakov 2015-03-11 1888 * case that all segments in the iov cannot be copied a632f559304130 Anton Altaparmakov 2015-03-11 1889 * at once without a pagefault. a632f559304130 Anton Altaparmakov 2015-03-11 1890 */ a632f559304130 Anton Altaparmakov 2015-03-11 1891 sc = iov_iter_single_seg_count(i); a632f559304130 Anton Altaparmakov 2015-03-11 1892 if (bytes > sc) a632f559304130 Anton Altaparmakov 2015-03-11 1893 bytes = sc; a632f559304130 Anton Altaparmakov 2015-03-11 1894 goto again; a632f559304130 Anton Altaparmakov 2015-03-11 1895 } a632f559304130 Anton Altaparmakov 2015-03-11 1896 iov_iter_advance(i, copied); a632f559304130 Anton Altaparmakov 2015-03-11 1897 pos += copied; a632f559304130 Anton Altaparmakov 2015-03-11 1898 written += copied; a632f559304130 Anton Altaparmakov 2015-03-11 1899 balance_dirty_pages_ratelimited(mapping); a632f559304130 Anton Altaparmakov 2015-03-11 1900 if (fatal_signal_pending(current)) { a632f559304130 Anton Altaparmakov 2015-03-11 1901 status = -EINTR; a632f559304130 Anton Altaparmakov 2015-03-11 1902 break; a632f559304130 Anton Altaparmakov 2015-03-11 1903 } a632f559304130 Anton Altaparmakov 2015-03-11 1904 } while (iov_iter_count(i)); 98b270362bb9ea Anton Altaparmakov 2005-10-11 1905 if (cached_page) 09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01 1906 put_page(cached_page); 98b270362bb9ea Anton Altaparmakov 2005-10-11 1907 ntfs_debug("Done. Returning %s (written 0x%lx, status %li).", 98b270362bb9ea Anton Altaparmakov 2005-10-11 1908 written ? "written" : "status", (unsigned long)written, 98b270362bb9ea Anton Altaparmakov 2005-10-11 1909 (long)status); 98b270362bb9ea Anton Altaparmakov 2005-10-11 1910 return written ? written : status; 98b270362bb9ea Anton Altaparmakov 2005-10-11 1911 } 98b270362bb9ea Anton Altaparmakov 2005-10-11 1912 :::::: The code at line 1727 was first introduced by commit :::::: a632f5593041305c8adbf4727bc1ccdf0b45178b NTFS: Version 2.1.32 - Update file write from aio_write to write_iter. :::::: TO: Anton Altaparmakov <anton@xxxxxxxxxx> :::::: CC: Al Viro <viro@xxxxxxxxxxxxxxxxxx> --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip