All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Andrey Albershteyn <aalbersh@redhat.com>, linux-xfs@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	djwong@kernel.org, david@fromorbit.com, hch@lst.de,
	Andrey Albershteyn <aalbersh@redhat.com>
Subject: Re: [PATCH 1/2] iomap: add iomap_writepages_unbound() to write beyond EOF
Date: Mon, 30 Dec 2024 01:54:38 +0800	[thread overview]
Message-ID: <202412300135.cvWMPZGf-lkp@intel.com> (raw)
In-Reply-To: <20241229133640.1193578-2-aalbersh@kernel.org>

Hi Andrey,

kernel test robot noticed the following build errors:

[auto build test ERROR on brauner-vfs/vfs.all]
[also build test ERROR on linus/master v6.13-rc4 next-20241220]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Andrey-Albershteyn/iomap-add-iomap_writepages_unbound-to-write-beyond-EOF/20241229-213942
base:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git vfs.all
patch link:    https://lore.kernel.org/r/20241229133640.1193578-2-aalbersh%40kernel.org
patch subject: [PATCH 1/2] iomap: add iomap_writepages_unbound() to write beyond EOF
config: s390-randconfig-002-20241229 (https://download.01.org/0day-ci/archive/20241230/202412300135.cvWMPZGf-lkp@intel.com/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241230/202412300135.cvWMPZGf-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412300135.cvWMPZGf-lkp@intel.com/

All errors (new ones prefixed by >>):

>> fs/iomap/buffered-io.c:982:23: error: use of undeclared identifier 'IOMAP_NOSIZE'
                   if (!(iter->flags & IOMAP_NOSIZE) && (pos + written > old_size)) {
                                       ^
   fs/iomap/buffered-io.c:988:23: error: use of undeclared identifier 'IOMAP_NOSIZE'
                   if (!(iter->flags & IOMAP_NOSIZE) && (old_size < pos))
                                       ^
   2 errors generated.


vim +/IOMAP_NOSIZE +982 fs/iomap/buffered-io.c

   909	
   910	static loff_t iomap_write_iter(struct iomap_iter *iter, struct iov_iter *i)
   911	{
   912		loff_t length = iomap_length(iter);
   913		loff_t pos = iter->pos;
   914		ssize_t total_written = 0;
   915		long status = 0;
   916		struct address_space *mapping = iter->inode->i_mapping;
   917		size_t chunk = mapping_max_folio_size(mapping);
   918		unsigned int bdp_flags = (iter->flags & IOMAP_NOWAIT) ? BDP_ASYNC : 0;
   919	
   920		do {
   921			struct folio *folio;
   922			loff_t old_size;
   923			size_t offset;		/* Offset into folio */
   924			size_t bytes;		/* Bytes to write to folio */
   925			size_t copied;		/* Bytes copied from user */
   926			size_t written;		/* Bytes have been written */
   927	
   928			bytes = iov_iter_count(i);
   929	retry:
   930			offset = pos & (chunk - 1);
   931			bytes = min(chunk - offset, bytes);
   932			status = balance_dirty_pages_ratelimited_flags(mapping,
   933								       bdp_flags);
   934			if (unlikely(status))
   935				break;
   936	
   937			if (bytes > length)
   938				bytes = length;
   939	
   940			/*
   941			 * Bring in the user page that we'll copy from _first_.
   942			 * Otherwise there's a nasty deadlock on copying from the
   943			 * same page as we're writing to, without it being marked
   944			 * up-to-date.
   945			 *
   946			 * For async buffered writes the assumption is that the user
   947			 * page has already been faulted in. This can be optimized by
   948			 * faulting the user page.
   949			 */
   950			if (unlikely(fault_in_iov_iter_readable(i, bytes) == bytes)) {
   951				status = -EFAULT;
   952				break;
   953			}
   954	
   955			status = iomap_write_begin(iter, pos, bytes, &folio);
   956			if (unlikely(status)) {
   957				iomap_write_failed(iter->inode, pos, bytes);
   958				break;
   959			}
   960			if (iter->iomap.flags & IOMAP_F_STALE)
   961				break;
   962	
   963			offset = offset_in_folio(folio, pos);
   964			if (bytes > folio_size(folio) - offset)
   965				bytes = folio_size(folio) - offset;
   966	
   967			if (mapping_writably_mapped(mapping))
   968				flush_dcache_folio(folio);
   969	
   970			copied = copy_folio_from_iter_atomic(folio, offset, bytes, i);
   971			written = iomap_write_end(iter, pos, bytes, copied, folio) ?
   972				  copied : 0;
   973	
   974			/*
   975			 * Update the in-memory inode size after copying the data into
   976			 * the page cache.  It's up to the file system to write the
   977			 * updated size to disk, preferably after I/O completion so that
   978			 * no stale data is exposed.  Only once that's done can we
   979			 * unlock and release the folio.
   980			 */
   981			old_size = iter->inode->i_size;
 > 982			if (!(iter->flags & IOMAP_NOSIZE) && (pos + written > old_size)) {
   983				i_size_write(iter->inode, pos + written);
   984				iter->iomap.flags |= IOMAP_F_SIZE_CHANGED;
   985			}
   986			__iomap_put_folio(iter, pos, written, folio);
   987	
   988			if (!(iter->flags & IOMAP_NOSIZE) && (old_size < pos))
   989				pagecache_isize_extended(iter->inode, old_size, pos);
   990	
   991			cond_resched();
   992			if (unlikely(written == 0)) {
   993				/*
   994				 * A short copy made iomap_write_end() reject the
   995				 * thing entirely.  Might be memory poisoning
   996				 * halfway through, might be a race with munmap,
   997				 * might be severe memory pressure.
   998				 */
   999				iomap_write_failed(iter->inode, pos, bytes);
  1000				iov_iter_revert(i, copied);
  1001	
  1002				if (chunk > PAGE_SIZE)
  1003					chunk /= 2;
  1004				if (copied) {
  1005					bytes = copied;
  1006					goto retry;
  1007				}
  1008			} else {
  1009				pos += written;
  1010				total_written += written;
  1011				length -= written;
  1012			}
  1013		} while (iov_iter_count(i) && length);
  1014	
  1015		if (status == -EAGAIN) {
  1016			iov_iter_revert(i, total_written);
  1017			return -EAGAIN;
  1018		}
  1019		return total_written ? total_written : status;
  1020	}
  1021	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  reply	other threads:[~2024-12-29 17:55 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-29 13:33 [RFC] Directly mapped xattr data & fs-verity Andrey Albershteyn
2024-12-29 13:35 ` [PATCH] xfs: direct mapped xattrs design documentation Andrey Albershteyn
2025-01-07  1:41   ` Darrick J. Wong
2025-01-07 10:24     ` Andrey Albershteyn
2024-12-29 13:36 ` [PATCH 0/2] Introduce iomap interface to work with regions beyond EOF Andrey Albershteyn
2024-12-29 13:36   ` [PATCH 1/2] iomap: add iomap_writepages_unbound() to write " Andrey Albershteyn
2024-12-29 17:54     ` kernel test robot [this message]
2024-12-29 21:36     ` kernel test robot
2024-12-29 13:36   ` [PATCH 2/2] iomap: introduce iomap_read/write_region interface Andrey Albershteyn
2024-12-29 13:38 ` [PATCH 00/14] Direct mapped extended attribute data Andrey Albershteyn
2024-12-29 13:38   ` [PATCH 01/14] iomap: add wrapper to pass readpage_ctx to read path Andrey Albershteyn
2024-12-29 13:38   ` [PATCH 02/14] iomap: add read path ioends for filesystem read verification Andrey Albershteyn
2024-12-29 13:38   ` [PATCH 03/14] iomap: introduce IOMAP_F_NO_MERGE for non-mergable ioends Andrey Albershteyn
2024-12-29 13:38   ` [PATCH 04/14] xfs: add incompat directly mapped xattr flag Andrey Albershteyn
2024-12-29 13:38   ` [PATCH 05/14] libxfs: add xfs_calc_chsum() Andrey Albershteyn
2024-12-29 13:38   ` [PATCH 06/14] libxfs: pass xfs_sb to xfs_attr3_leaf_name_remote() Andrey Albershteyn
2024-12-29 13:38   ` [PATCH 07/14] xfs: introduce XFS_DA_OP_EMPTY Andrey Albershteyn
2024-12-29 13:38   ` [PATCH 08/14] xfs: introduce workqueue for post read processing Andrey Albershteyn
2024-12-29 13:38   ` [PATCH 09/14] xfs: add interface to set CRC on leaf attributes Andrey Albershteyn
2024-12-29 13:38   ` [PATCH 10/14] xfs: introduce XFS_ATTRUPDATE_FLAGS operation Andrey Albershteyn
2024-12-29 13:38   ` [PATCH 11/14] xfs: add interface for page cache mapped remote xattrs Andrey Albershteyn
2024-12-29 13:38   ` [PATCH 12/14] xfs: parse both remote attr name on-disk formats Andrey Albershteyn
2024-12-29 13:38   ` [PATCH 13/14] xfs: do not use xfs_attr3_rmt_hdr for remote value blocks for dxattr Andrey Albershteyn
2024-12-29 13:38   ` [PATCH 14/14] xfs: enalbe XFS_SB_FEAT_INCOMPAT_DXATTR Andrey Albershteyn
2024-12-29 13:39 ` [PATCH 00/24] fsverity integration for XFS based on direct mapped xattrs Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 01/24] fs: add FS_XFLAG_VERITY for verity files Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 02/24] fsverity: pass tree_blocksize to end_enable_verity() Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 03/24] fsverity: add tracepoints Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 04/24] fsverity: pass the new tree size and block size to ->begin_enable_verity Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 05/24] fsverity: expose merkle tree geometry to callers Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 06/24] fsverity: report validation errors back to the filesystem Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 07/24] fsverity: flush pagecache before enabling verity Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 08/24] iomap: integrate fs-verity verification into iomap's read path Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 09/24] xfs: use an empty transaction to protect xfs_attr_get from deadlocks Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 10/24] xfs: don't let xfs_bmap_first_unused overflow a xfs_dablk_t Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 11/24] xfs: add attribute type for fs-verity Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 12/24] xfs: add fs-verity ro-compat flag Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 13/24] xfs: add inode on-disk VERITY flag Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 14/24] xfs: initialize fs-verity on file open and cleanup on inode destruction Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 15/24] xfs: don't allow to enable DAX on fs-verity sealed inode Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 16/24] xfs: disable direct read path for fs-verity files Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 17/24] xfs: add fs-verity support Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 18/24] xfs: add writeback page mapping for fs-verity Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 19/24] xfs: use merkle tree offset as attr hash Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 20/24] xfs: add fs-verity ioctls Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 21/24] xfs: advertise fs-verity being available on filesystem Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 22/24] xfs: check and repair the verity inode flag state Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 23/24] xfs: report verity failures through the health system Andrey Albershteyn
2024-12-29 13:39   ` [PATCH 24/24] xfs: enable ro-compat fs-verity flag Andrey Albershteyn
2025-01-06 15:42 ` [RFC] Directly mapped xattr data & fs-verity Christoph Hellwig
2025-01-06 19:50   ` Darrick J. Wong
2025-01-06 20:56   ` Andrey Albershteyn
2025-01-07 16:50     ` Christoph Hellwig
2025-01-08  9:20       ` Andrey Albershteyn
2025-01-09  6:12         ` Christoph Hellwig
2025-01-09  7:39         ` Darrick J. Wong
2025-01-09  7:44           ` Christoph Hellwig
2025-01-09 17:03             ` Darrick J. Wong
2025-01-13  9:16           ` Andrey Albershteyn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202412300135.cvWMPZGf-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=aalbersh@redhat.com \
    --cc=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.