From: kernel test robot <lkp@intel.com>
To: Jan Kara <jack@suse.cz>, linux-fsdevel@vger.kernel.org
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
Christoph Hellwig <hch@infradead.org>,
Amir Goldstein <amir73il@gmail.com>,
Dave Chinner <david@fromorbit.com>, Ted Tso <tytso@mit.edu>,
Jan Kara <jack@suse.cz>, Jaegeuk Kim <jaegeuk@kernel.org>,
Chao Yu <yuchao0@huawei.com>, Chao Yu <chao@kernel.org>,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH 07/12] f2fs: Convert to using invalidate_lock
Date: Sat, 24 Apr 2021 04:05:04 +0800 [thread overview]
Message-ID: <202104240353.hrooocwr-lkp@intel.com> (raw)
In-Reply-To: <20210423173018.23133-7-jack@suse.cz>
[-- Attachment #1: Type: text/plain, Size: 5429 bytes --]
Hi Jan,
I love your patch! Yet something to improve:
[auto build test ERROR on ext4/dev]
[also build test ERROR on fuse/for-next linus/master v5.12-rc8]
[cannot apply to hnaz-linux-mm/master next-20210423]
[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/20210424-013114
base: https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
config: arm-randconfig-r031-20210423 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 06234f758e1945084582cf80450b396f75a9c06e)
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 arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/0day-ci/linux/commit/7a9e8e67e7f7d0070294e9f0a3567a3f28985383
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/20210424-013114
git checkout 7a9e8e67e7f7d0070294e9f0a3567a3f28985383
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm
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:3567:14: error: use of undeclared identifier 'mapping'
down_write(&mapping->invalidate_lock);
^
fs/f2fs/file.c:3603:12: error: use of undeclared identifier 'mapping'
up_write(&mapping->invalidate_lock);
^
2 errors generated.
vim +/mapping +3567 fs/f2fs/file.c
3515
3516 static int f2fs_release_compress_blocks(struct file *filp, unsigned long arg)
3517 {
3518 struct inode *inode = file_inode(filp);
3519 struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
3520 pgoff_t page_idx = 0, last_idx;
3521 unsigned int released_blocks = 0;
3522 int ret;
3523 int writecount;
3524
3525 if (!f2fs_sb_has_compression(F2FS_I_SB(inode)))
3526 return -EOPNOTSUPP;
3527
3528 if (!f2fs_compressed_file(inode))
3529 return -EINVAL;
3530
3531 if (f2fs_readonly(sbi->sb))
3532 return -EROFS;
3533
3534 ret = mnt_want_write_file(filp);
3535 if (ret)
3536 return ret;
3537
3538 f2fs_balance_fs(F2FS_I_SB(inode), true);
3539
3540 inode_lock(inode);
3541
3542 writecount = atomic_read(&inode->i_writecount);
3543 if ((filp->f_mode & FMODE_WRITE && writecount != 1) ||
3544 (!(filp->f_mode & FMODE_WRITE) && writecount)) {
3545 ret = -EBUSY;
3546 goto out;
3547 }
3548
3549 if (IS_IMMUTABLE(inode)) {
3550 ret = -EINVAL;
3551 goto out;
3552 }
3553
3554 ret = filemap_write_and_wait_range(inode->i_mapping, 0, LLONG_MAX);
3555 if (ret)
3556 goto out;
3557
3558 F2FS_I(inode)->i_flags |= F2FS_IMMUTABLE_FL;
3559 f2fs_set_inode_flags(inode);
3560 inode->i_ctime = current_time(inode);
3561 f2fs_mark_inode_dirty_sync(inode, true);
3562
3563 if (!atomic_read(&F2FS_I(inode)->i_compr_blocks))
3564 goto out;
3565
3566 down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
> 3567 down_write(&mapping->invalidate_lock);
3568
3569 last_idx = DIV_ROUND_UP(i_size_read(inode), PAGE_SIZE);
3570
3571 while (page_idx < last_idx) {
3572 struct dnode_of_data dn;
3573 pgoff_t end_offset, count;
3574
3575 set_new_dnode(&dn, inode, NULL, NULL, 0);
3576 ret = f2fs_get_dnode_of_data(&dn, page_idx, LOOKUP_NODE);
3577 if (ret) {
3578 if (ret == -ENOENT) {
3579 page_idx = f2fs_get_next_page_offset(&dn,
3580 page_idx);
3581 ret = 0;
3582 continue;
3583 }
3584 break;
3585 }
3586
3587 end_offset = ADDRS_PER_PAGE(dn.node_page, inode);
3588 count = min(end_offset - dn.ofs_in_node, last_idx - page_idx);
3589 count = round_up(count, F2FS_I(inode)->i_cluster_size);
3590
3591 ret = release_compress_blocks(&dn, count);
3592
3593 f2fs_put_dnode(&dn);
3594
3595 if (ret < 0)
3596 break;
3597
3598 page_idx += count;
3599 released_blocks += ret;
3600 }
3601
3602 up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
3603 up_write(&mapping->invalidate_lock);
3604 out:
3605 inode_unlock(inode);
3606
3607 mnt_drop_write_file(filp);
3608
3609 if (ret >= 0) {
3610 ret = put_user(released_blocks, (u64 __user *)arg);
3611 } else if (released_blocks &&
3612 atomic_read(&F2FS_I(inode)->i_compr_blocks)) {
3613 set_sbi_flag(sbi, SBI_NEED_FSCK);
3614 f2fs_warn(sbi, "%s: partial blocks were released i_ino=%lx "
3615 "iblocks=%llu, released=%u, compr_blocks=%u, "
3616 "run fsck to fix.",
3617 __func__, inode->i_ino, inode->i_blocks,
3618 released_blocks,
3619 atomic_read(&F2FS_I(inode)->i_compr_blocks));
3620 }
3621
3622 return ret;
3623 }
3624
---
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: 33609 bytes --]
next prev parent reply other threads:[~2021-04-23 20:05 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-23 17:29 [PATCH 0/12 v4] fs: Hole punch vs page cache filling races Jan Kara
2021-04-23 17:29 ` [PATCH 01/12] mm: Fix comments mentioning i_mutex Jan Kara
2021-04-23 17:29 ` [PATCH 02/12] mm: Protect operations adding pages to page cache with invalidate_lock Jan Kara
2021-04-23 18:30 ` Matthew Wilcox
2021-04-23 23:04 ` Dave Chinner
2021-04-26 15:46 ` Jan Kara
2021-04-23 17:29 ` [PATCH 03/12] ext4: Convert to use mapping->invalidate_lock Jan Kara
2021-04-23 17:29 ` [PATCH 04/12] ext2: Convert to using invalidate_lock Jan Kara
2021-04-23 17:29 ` [PATCH 05/12] xfs: Convert to use invalidate_lock Jan Kara
2021-04-23 22:39 ` Dave Chinner
2021-04-23 17:29 ` [PATCH 06/12] zonefs: Convert to using invalidate_lock Jan Kara
2021-04-26 6:40 ` Damien Le Moal
2021-04-26 16:24 ` Jan Kara
2021-04-23 17:29 ` [PATCH 07/12] f2fs: " Jan Kara
2021-04-23 19:15 ` kernel test robot
2021-04-23 20:05 ` kernel test robot [this message]
2021-04-23 17:29 ` [PATCH 08/12] fuse: " Jan Kara
2021-04-23 17:29 ` [PATCH 09/12] shmem: " Jan Kara
2021-04-29 4:12 ` Hugh Dickins
2021-04-29 9:30 ` Jan Kara
2021-04-23 17:29 ` [PATCH 10/12] shmem: Use invalidate_lock to protect fallocate Jan Kara
2021-04-23 19:27 ` kernel test robot
2021-04-29 3:24 ` Hugh Dickins
2021-04-29 9:20 ` Jan Kara
2021-04-23 17:29 ` [PATCH 11/12] ceph: Fix race between hole punch and page fault Jan Kara
2021-04-23 17:29 ` [PATCH 12/12] cifs: " Jan Kara
2021-04-23 22:07 ` [PATCH 0/12 v4] fs: Hole punch vs page cache filling races Dave Chinner
2021-04-23 23:51 ` Matthew Wilcox
2021-04-24 6:11 ` Christoph Hellwig
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=202104240353.hrooocwr-lkp@intel.com \
--to=lkp@intel.com \
--cc=amir73il@gmail.com \
--cc=chao@kernel.org \
--cc=clang-built-linux@googlegroups.com \
--cc=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=jack@suse.cz \
--cc=jaegeuk@kernel.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=tytso@mit.edu \
--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).