ceph-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jan Kara <jack@suse.cz>, linux-fsdevel@vger.kernel.org
Cc: kbuild-all@lists.01.org, Christoph Hellwig <hch@infradead.org>,
	Dave Chinner <david@fromorbit.com>,
	ceph-devel@vger.kernel.org, Chao Yu <yuchao0@huawei.com>,
	Chao Yu <chao@kernel.org>, Damien Le Moal <damien.lemoal@wdc.com>,
	"Darrick J. Wong" <darrick.wong@oracle.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	Jeff Layton <jlayton@kernel.org>,
	Johannes Thumshirn <jth@kernel.org>
Subject: Re: [PATCH 08/11] f2fs: Convert to using invalidate_lock
Date: Thu, 13 May 2021 02:00:19 +0800	[thread overview]
Message-ID: <202105130140.ldveM0rO-lkp@intel.com> (raw)
In-Reply-To: <20210512134631.4053-8-jack@suse.cz>

[-- Attachment #1: Type: text/plain, Size: 10083 bytes --]

Hi Jan,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.13-rc1]
[cannot apply to hnaz-linux-mm/master ext4/dev fuse/for-next next-20210512]
[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]

url:    https://github.com/0day-ci/linux/commits/Jan-Kara/fs-Hole-punch-vs-page-cache-filling-races/20210512-214713
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 88b06399c9c766c283e070b022b5ceafa4f63f19
config: x86_64-rhel-8.3 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/12e7111c8a1e839ea70ac4c8bf24677466cbe767
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Jan-Kara/fs-Hole-punch-vs-page-cache-filling-races/20210512-214713
        git checkout 12e7111c8a1e839ea70ac4c8bf24677466cbe767
        # save the attached .config to linux build tree
        make W=1 W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   fs/f2fs/file.c: In function 'f2fs_file_write_iter':
>> fs/f2fs/file.c:4314:29: error: 'struct f2fs_inode_info' has no member named 'i_mmap_sem'
    4314 |    down_write(&F2FS_I(inode)->i_mmap_sem);
         |                             ^~
   fs/f2fs/file.c:4316:27: error: 'struct f2fs_inode_info' has no member named 'i_mmap_sem'
    4316 |    up_write(&F2FS_I(inode)->i_mmap_sem);
         |                           ^~


vim +4314 fs/f2fs/file.c

4c8ff7095bef64 Chao Yu           2019-11-01  4223  
fcc85a4d86b501 Jaegeuk Kim       2015-04-21  4224  static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
fcc85a4d86b501 Jaegeuk Kim       2015-04-21  4225  {
b439b103a6c9eb Jaegeuk Kim       2016-02-03  4226  	struct file *file = iocb->ki_filp;
b439b103a6c9eb Jaegeuk Kim       2016-02-03  4227  	struct inode *inode = file_inode(file);
b439b103a6c9eb Jaegeuk Kim       2016-02-03  4228  	ssize_t ret;
fcc85a4d86b501 Jaegeuk Kim       2015-04-21  4229  
126ce7214d2134 Chao Yu           2019-04-02  4230  	if (unlikely(f2fs_cp_error(F2FS_I_SB(inode)))) {
126ce7214d2134 Chao Yu           2019-04-02  4231  		ret = -EIO;
126ce7214d2134 Chao Yu           2019-04-02  4232  		goto out;
126ce7214d2134 Chao Yu           2019-04-02  4233  	}
1f227a3e215d36 Jaegeuk Kim       2017-10-23  4234  
7bd2935870c050 Chao Yu           2020-02-24  4235  	if (!f2fs_is_compress_backend_ready(inode)) {
7bd2935870c050 Chao Yu           2020-02-24  4236  		ret = -EOPNOTSUPP;
7bd2935870c050 Chao Yu           2020-02-24  4237  		goto out;
7bd2935870c050 Chao Yu           2020-02-24  4238  	}
4c8ff7095bef64 Chao Yu           2019-11-01  4239  
126ce7214d2134 Chao Yu           2019-04-02  4240  	if (iocb->ki_flags & IOCB_NOWAIT) {
cb8434f16479b6 Goldwyn Rodrigues 2019-09-11  4241  		if (!inode_trylock(inode)) {
126ce7214d2134 Chao Yu           2019-04-02  4242  			ret = -EAGAIN;
126ce7214d2134 Chao Yu           2019-04-02  4243  			goto out;
126ce7214d2134 Chao Yu           2019-04-02  4244  		}
cb8434f16479b6 Goldwyn Rodrigues 2019-09-11  4245  	} else {
b439b103a6c9eb Jaegeuk Kim       2016-02-03  4246  		inode_lock(inode);
b91050a80cec3d Hyunchul Lee      2018-03-08  4247  	}
b91050a80cec3d Hyunchul Lee      2018-03-08  4248  
e0fcd01510ad02 Chao Yu           2020-12-26  4249  	if (unlikely(IS_IMMUTABLE(inode))) {
e0fcd01510ad02 Chao Yu           2020-12-26  4250  		ret = -EPERM;
e0fcd01510ad02 Chao Yu           2020-12-26  4251  		goto unlock;
e0fcd01510ad02 Chao Yu           2020-12-26  4252  	}
e0fcd01510ad02 Chao Yu           2020-12-26  4253  
b439b103a6c9eb Jaegeuk Kim       2016-02-03  4254  	ret = generic_write_checks(iocb, from);
b439b103a6c9eb Jaegeuk Kim       2016-02-03  4255  	if (ret > 0) {
dc7a10ddee0c56 Jaegeuk Kim       2018-03-30  4256  		bool preallocated = false;
dc7a10ddee0c56 Jaegeuk Kim       2018-03-30  4257  		size_t target_size = 0;
dc91de78e5e1d4 Jaegeuk Kim       2017-01-13  4258  		int err;
dc91de78e5e1d4 Jaegeuk Kim       2017-01-13  4259  
dc91de78e5e1d4 Jaegeuk Kim       2017-01-13  4260  		if (iov_iter_fault_in_readable(from, iov_iter_count(from)))
dc91de78e5e1d4 Jaegeuk Kim       2017-01-13  4261  			set_inode_flag(inode, FI_NO_PREALLOC);
a7de608691f766 Jaegeuk Kim       2016-11-11  4262  
d5d5f0c0c9160f Chengguang Xu     2019-04-23  4263  		if ((iocb->ki_flags & IOCB_NOWAIT)) {
b91050a80cec3d Hyunchul Lee      2018-03-08  4264  			if (!f2fs_overwrite_io(inode, iocb->ki_pos,
b91050a80cec3d Hyunchul Lee      2018-03-08  4265  						iov_iter_count(from)) ||
b91050a80cec3d Hyunchul Lee      2018-03-08  4266  				f2fs_has_inline_data(inode) ||
d5d5f0c0c9160f Chengguang Xu     2019-04-23  4267  				f2fs_force_buffered_io(inode, iocb, from)) {
d5d5f0c0c9160f Chengguang Xu     2019-04-23  4268  				clear_inode_flag(inode, FI_NO_PREALLOC);
b91050a80cec3d Hyunchul Lee      2018-03-08  4269  				inode_unlock(inode);
126ce7214d2134 Chao Yu           2019-04-02  4270  				ret = -EAGAIN;
126ce7214d2134 Chao Yu           2019-04-02  4271  				goto out;
b91050a80cec3d Hyunchul Lee      2018-03-08  4272  			}
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4273  			goto write;
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4274  		}
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4275  
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4276  		if (is_inode_flag_set(inode, FI_NO_PREALLOC))
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4277  			goto write;
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4278  
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4279  		if (iocb->ki_flags & IOCB_DIRECT) {
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4280  			/*
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4281  			 * Convert inline data for Direct I/O before entering
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4282  			 * f2fs_direct_IO().
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4283  			 */
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4284  			err = f2fs_convert_inline_inode(inode);
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4285  			if (err)
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4286  				goto out_err;
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4287  			/*
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4288  			 * If force_buffere_io() is true, we have to allocate
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4289  			 * blocks all the time, since f2fs_direct_IO will fall
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4290  			 * back to buffered IO.
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4291  			 */
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4292  			if (!f2fs_force_buffered_io(inode, iocb, from) &&
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4293  					allow_outplace_dio(inode, iocb, from))
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4294  				goto write;
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4295  		}
dc7a10ddee0c56 Jaegeuk Kim       2018-03-30  4296  		preallocated = true;
dc7a10ddee0c56 Jaegeuk Kim       2018-03-30  4297  		target_size = iocb->ki_pos + iov_iter_count(from);
dc7a10ddee0c56 Jaegeuk Kim       2018-03-30  4298  
dc91de78e5e1d4 Jaegeuk Kim       2017-01-13  4299  		err = f2fs_preallocate_blocks(iocb, from);
a7de608691f766 Jaegeuk Kim       2016-11-11  4300  		if (err) {
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4301  out_err:
28cfafb73853f0 Chao Yu           2017-11-13  4302  			clear_inode_flag(inode, FI_NO_PREALLOC);
a7de608691f766 Jaegeuk Kim       2016-11-11  4303  			inode_unlock(inode);
126ce7214d2134 Chao Yu           2019-04-02  4304  			ret = err;
126ce7214d2134 Chao Yu           2019-04-02  4305  			goto out;
a7de608691f766 Jaegeuk Kim       2016-11-11  4306  		}
47501f87c61ad2 Jaegeuk Kim       2019-11-26  4307  write:
b439b103a6c9eb Jaegeuk Kim       2016-02-03  4308  		ret = __generic_file_write_iter(iocb, from);
dc91de78e5e1d4 Jaegeuk Kim       2017-01-13  4309  		clear_inode_flag(inode, FI_NO_PREALLOC);
b0af6d491a6b5f Chao Yu           2017-08-02  4310  
dc7a10ddee0c56 Jaegeuk Kim       2018-03-30  4311  		/* if we couldn't write data, we should deallocate blocks. */
a303b0ac920d80 Chao Yu           2021-04-01  4312  		if (preallocated && i_size_read(inode) < target_size) {
a303b0ac920d80 Chao Yu           2021-04-01  4313  			down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
a303b0ac920d80 Chao Yu           2021-04-01 @4314  			down_write(&F2FS_I(inode)->i_mmap_sem);
dc7a10ddee0c56 Jaegeuk Kim       2018-03-30  4315  			f2fs_truncate(inode);
a303b0ac920d80 Chao Yu           2021-04-01  4316  			up_write(&F2FS_I(inode)->i_mmap_sem);
a303b0ac920d80 Chao Yu           2021-04-01  4317  			up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
a303b0ac920d80 Chao Yu           2021-04-01  4318  		}
dc7a10ddee0c56 Jaegeuk Kim       2018-03-30  4319  
b0af6d491a6b5f Chao Yu           2017-08-02  4320  		if (ret > 0)
b0af6d491a6b5f Chao Yu           2017-08-02  4321  			f2fs_update_iostat(F2FS_I_SB(inode), APP_WRITE_IO, ret);
9dfa1baff76d08 Jaegeuk Kim       2016-07-13  4322  	}
e0fcd01510ad02 Chao Yu           2020-12-26  4323  unlock:
b439b103a6c9eb Jaegeuk Kim       2016-02-03  4324  	inode_unlock(inode);
126ce7214d2134 Chao Yu           2019-04-02  4325  out:
126ce7214d2134 Chao Yu           2019-04-02  4326  	trace_f2fs_file_write_iter(inode, iocb->ki_pos,
126ce7214d2134 Chao Yu           2019-04-02  4327  					iov_iter_count(from), ret);
e259221763a404 Christoph Hellwig 2016-04-07  4328  	if (ret > 0)
e259221763a404 Christoph Hellwig 2016-04-07  4329  		ret = generic_write_sync(iocb, ret);
b439b103a6c9eb Jaegeuk Kim       2016-02-03  4330  	return ret;
fcc85a4d86b501 Jaegeuk Kim       2015-04-21  4331  }
fcc85a4d86b501 Jaegeuk Kim       2015-04-21  4332  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 41425 bytes --]

  reply	other threads:[~2021-05-12 19:49 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12 13:46 [PATCH 0/11 v5] fs: Hole punch vs page cache filling races Jan Kara
2021-05-12 13:46 ` [PATCH 01/11] mm: Fix comments mentioning i_mutex Jan Kara
2021-05-12 13:46 ` [PATCH 02/11] documentation: Sync file_operations members with reality Jan Kara
2021-05-12 13:46 ` [PATCH 03/11] mm: Protect operations adding pages to page cache with invalidate_lock Jan Kara
2021-05-12 14:20   ` Matthew Wilcox
2021-05-13 17:49     ` Jan Kara
2021-05-12 14:40   ` Matthew Wilcox
2021-05-13 19:01     ` Jan Kara
2021-05-13 19:38       ` Matthew Wilcox
2021-05-14 11:07         ` Jan Kara
2021-05-12 15:23   ` Darrick J. Wong
2021-05-13 17:44     ` Jan Kara
2021-05-13 18:52       ` Darrick J. Wong
2021-05-13 23:19         ` Dave Chinner
2021-05-14 16:17           ` Darrick J. Wong
2021-05-17 11:21             ` Jan Kara
2021-05-18 22:36             ` Dave Chinner
2021-05-19 10:57               ` Jan Kara
2021-05-12 13:46 ` [PATCH 04/11] ext4: Convert to use mapping->invalidate_lock Jan Kara
2021-05-12 13:46 ` [PATCH 05/11] ext2: Convert to using invalidate_lock Jan Kara
2021-05-12 13:46 ` [PATCH 06/11] xfs: Convert to use invalidate_lock Jan Kara
2021-05-12 13:46 ` [PATCH 07/11] zonefs: Convert to using invalidate_lock Jan Kara
2021-05-13  0:34   ` Damien Le Moal
2021-05-12 13:46 ` [PATCH 08/11] f2fs: " Jan Kara
2021-05-12 18:00   ` kernel test robot [this message]
2021-05-12 13:46 ` [PATCH 09/11] fuse: " Jan Kara
2021-05-12 13:46 ` [PATCH 10/11] ceph: Fix race between hole punch and page fault Jan Kara
2021-05-12 15:19   ` Jeff Layton
2021-05-12 13:46 ` [PATCH 11/11] cifs: " Jan Kara

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=202105130140.ldveM0rO-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=chao@kernel.org \
    --cc=damien.lemoal@wdc.com \
    --cc=darrick.wong@oracle.com \
    --cc=david@fromorbit.com \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=jaegeuk@kernel.org \
    --cc=jlayton@kernel.org \
    --cc=jth@kernel.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=yuchao0@huawei.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).