From: kernel test robot <lkp@intel.com>
To: Ming Lei <ming.lei@redhat.com>, Jens Axboe <axboe@kernel.dk>
Cc: kbuild-all@lists.01.org, linux-block@vger.kernel.org,
Ming Lei <ming.lei@redhat.com>, Jan Kara <jack@suse.cz>
Subject: Re: [PATCH] block: hold ->invalidate_lock in blkdev_fallocate
Date: Wed, 15 Sep 2021 22:41:11 +0800 [thread overview]
Message-ID: <202109152226.ob8m5TxP-lkp@intel.com> (raw)
In-Reply-To: <20210915123545.1000534-1-ming.lei@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 4665 bytes --]
Hi Ming,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on v5.14-rc7]
[cannot apply to v5.15-rc1 next-20210915]
[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/Ming-Lei/block-hold-invalidate_lock-in-blkdev_fallocate/20210915-203759
base: e22ce8eb631bdc47a4a4ea7ecf4e4ba499db4f93
config: nds32-defconfig (attached as .config)
compiler: nds32le-linux-gcc (GCC) 11.2.0
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
# https://github.com/0day-ci/linux/commit/802c451a54927267d87a707d2a5fe3e47bc4ca1c
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Ming-Lei/block-hold-invalidate_lock-in-blkdev_fallocate/20210915-203759
git checkout 802c451a54927267d87a707d2a5fe3e47bc4ca1c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=nds32
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/block_dev.c: In function 'blkdev_fallocate':
>> fs/block_dev.c:1730:9: error: implicit declaration of function 'filemap_invalidate_lock' [-Werror=implicit-function-declaration]
1730 | filemap_invalidate_lock(inode->i_mapping);
| ^~~~~~~~~~~~~~~~~~~~~~~
>> fs/block_dev.c:1762:9: error: implicit declaration of function 'filemap_invalidate_unlock' [-Werror=implicit-function-declaration]
1762 | filemap_invalidate_unlock(inode->i_mapping);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/filemap_invalidate_lock +1730 fs/block_dev.c
1694
1695 #define BLKDEV_FALLOC_FL_SUPPORTED \
1696 (FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE | \
1697 FALLOC_FL_ZERO_RANGE | FALLOC_FL_NO_HIDE_STALE)
1698
1699 static long blkdev_fallocate(struct file *file, int mode, loff_t start,
1700 loff_t len)
1701 {
1702 struct inode *inode = bdev_file_inode(file);
1703 struct block_device *bdev = I_BDEV(inode);
1704 loff_t end = start + len - 1;
1705 loff_t isize;
1706 int error;
1707
1708 /* Fail if we don't recognize the flags. */
1709 if (mode & ~BLKDEV_FALLOC_FL_SUPPORTED)
1710 return -EOPNOTSUPP;
1711
1712 /* Don't go off the end of the device. */
1713 isize = i_size_read(bdev->bd_inode);
1714 if (start >= isize)
1715 return -EINVAL;
1716 if (end >= isize) {
1717 if (mode & FALLOC_FL_KEEP_SIZE) {
1718 len = isize - start;
1719 end = start + len - 1;
1720 } else
1721 return -EINVAL;
1722 }
1723
1724 /*
1725 * Don't allow IO that isn't aligned to logical block size.
1726 */
1727 if ((start | len) & (bdev_logical_block_size(bdev) - 1))
1728 return -EINVAL;
1729
> 1730 filemap_invalidate_lock(inode->i_mapping);
1731
1732 /* Invalidate the page cache, including dirty pages. */
1733 error = truncate_bdev_range(bdev, file->f_mode, start, end);
1734 if (error)
1735 goto fail;
1736
1737 switch (mode) {
1738 case FALLOC_FL_ZERO_RANGE:
1739 case FALLOC_FL_ZERO_RANGE | FALLOC_FL_KEEP_SIZE:
1740 error = blkdev_issue_zeroout(bdev, start >> 9, len >> 9,
1741 GFP_KERNEL, BLKDEV_ZERO_NOUNMAP);
1742 break;
1743 case FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE:
1744 error = blkdev_issue_zeroout(bdev, start >> 9, len >> 9,
1745 GFP_KERNEL, BLKDEV_ZERO_NOFALLBACK);
1746 break;
1747 case FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE | FALLOC_FL_NO_HIDE_STALE:
1748 error = blkdev_issue_discard(bdev, start >> 9, len >> 9,
1749 GFP_KERNEL, 0);
1750 break;
1751 default:
1752 error = -EOPNOTSUPP;
1753 }
1754 /*
1755 * Invalidate the page cache again; if someone wandered in and dirtied
1756 * a page, we just discard it - userspace has no way of knowing whether
1757 * the write happened before or after discard completing...
1758 */
1759 if (!error)
1760 error = truncate_bdev_range(bdev, file->f_mode, start, end);
1761 fail:
> 1762 filemap_invalidate_unlock(inode->i_mapping);
1763 return error;
1764 }
1765
---
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: 10911 bytes --]
next prev parent reply other threads:[~2021-09-15 14:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-15 12:35 [PATCH] block: hold ->invalidate_lock in blkdev_fallocate Ming Lei
2021-09-15 14:41 ` kernel test robot [this message]
2021-09-16 14:16 ` Jan Kara
2021-09-23 1:51 ` Ming Lei
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=202109152226.ob8m5TxP-lkp@intel.com \
--to=lkp@intel.com \
--cc=axboe@kernel.dk \
--cc=jack@suse.cz \
--cc=kbuild-all@lists.01.org \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.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