diff mbox series

[11/11] btrfs: remove extraneous includes from ctree.h

Message ID ed1caf5b26573e62547cb3b96031af66c0f082ca.1692798556.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series btrfs: ctree.[ch] cleanups | expand

Commit Message

Josef Bacik Aug. 23, 2023, 1:51 p.m. UTC
We don't need any of these includes in the ctree.h header file for the
header file itself, remove them to clean up ctree.h a little bit.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/ctree.h | 28 ----------------------------
 1 file changed, 28 deletions(-)

Comments

kernel test robot Aug. 25, 2023, 2:21 p.m. UTC | #1
Hi Josef,

kernel test robot noticed the following build errors:

[auto build test ERROR on kdave/for-next]
[also build test ERROR on next-20230825]
[cannot apply to linus/master v6.5-rc7]
[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/Josef-Bacik/btrfs-move-btrfs_crc32c_final-into-free-space-cache-c/20230823-215354
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
patch link:    https://lore.kernel.org/r/ed1caf5b26573e62547cb3b96031af66c0f082ca.1692798556.git.josef%40toxicpanda.com
patch subject: [PATCH 11/11] btrfs: remove extraneous includes from ctree.h
config: arc-randconfig-001-20230824 (https://download.01.org/0day-ci/archive/20230825/202308252218.ReiikzVx-lkp@intel.com/config)
compiler: arc-elf-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230825/202308252218.ReiikzVx-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/202308252218.ReiikzVx-lkp@intel.com/

All errors (new ones prefixed by >>):

   fs/btrfs/super.c: In function 'btrfs_mount_root':
>> fs/btrfs/super.c:1453:25: error: implicit declaration of function 'security_sb_eat_lsm_opts' [-Werror=implicit-function-declaration]
    1453 |                 error = security_sb_eat_lsm_opts(data, &new_sec_opts);
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~
>> fs/btrfs/super.c:1528:25: error: implicit declaration of function 'security_sb_set_mnt_opts' [-Werror=implicit-function-declaration]
    1528 |                 error = security_sb_set_mnt_opts(s, new_sec_opts, 0, NULL);
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~
>> fs/btrfs/super.c:1529:9: error: implicit declaration of function 'security_free_mnt_opts' [-Werror=implicit-function-declaration]
    1529 |         security_free_mnt_opts(&new_sec_opts);
         |         ^~~~~~~~~~~~~~~~~~~~~~
   fs/btrfs/super.c: In function 'btrfs_remount':
>> fs/btrfs/super.c:1704:31: error: implicit declaration of function 'security_sb_remount' [-Werror=implicit-function-declaration]
    1704 |                         ret = security_sb_remount(sb, new_sec_opts);
         |                               ^~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +/security_sb_eat_lsm_opts +1453 fs/btrfs/super.c

450ba0ea06b6ed3 Josef Bacik       2010-11-19  1433  
312c89fbca06896 Misono, Tomohiro  2017-12-14  1434  /*
312c89fbca06896 Misono, Tomohiro  2017-12-14  1435   * Find a superblock for the given device / mount point.
312c89fbca06896 Misono, Tomohiro  2017-12-14  1436   *
312c89fbca06896 Misono, Tomohiro  2017-12-14  1437   * Note: This is based on mount_bdev from fs/super.c with a few additions
312c89fbca06896 Misono, Tomohiro  2017-12-14  1438   *       for multiple device setup.  Make sure to keep it in sync.
312c89fbca06896 Misono, Tomohiro  2017-12-14  1439   */
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1440  static struct dentry *btrfs_mount_root(struct file_system_type *fs_type,
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1441  		int flags, const char *device_name, void *data)
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1442  {
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1443  	struct block_device *bdev = NULL;
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1444  	struct super_block *s;
36350e95a2b1fee Gu Jinxiang       2018-07-12  1445  	struct btrfs_device *device = NULL;
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1446  	struct btrfs_fs_devices *fs_devices = NULL;
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1447  	struct btrfs_fs_info *fs_info = NULL;
204cc0ccf1d49c6 Al Viro           2018-12-13  1448  	void *new_sec_opts = NULL;
05bdb9965305bbf Christoph Hellwig 2023-06-08  1449  	blk_mode_t mode = sb_open_mode(flags);
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1450  	int error = 0;
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1451  
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1452  	if (data) {
a65001e8a4d4656 Al Viro           2018-12-10 @1453  		error = security_sb_eat_lsm_opts(data, &new_sec_opts);
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1454  		if (error)
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1455  			return ERR_PTR(error);
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1456  	}
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1457  
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1458  	/*
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1459  	 * Setup a dummy root and fs_info for test/set super.  This is because
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1460  	 * we don't actually fill this stuff out until open_ctree, but we need
8260edba67a2e6b Josef Bacik       2020-01-24  1461  	 * then open_ctree will properly initialize the file system specific
8260edba67a2e6b Josef Bacik       2020-01-24  1462  	 * settings later.  btrfs_init_fs_info initializes the static elements
8260edba67a2e6b Josef Bacik       2020-01-24  1463  	 * of the fs_info (locks and such) to make cleanup easier if we find a
8260edba67a2e6b Josef Bacik       2020-01-24  1464  	 * superblock with our given fs_devices later on at sget() time.
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1465  	 */
a8fd1f71749387c Jeff Mahoney      2018-02-15  1466  	fs_info = kvzalloc(sizeof(struct btrfs_fs_info), GFP_KERNEL);
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1467  	if (!fs_info) {
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1468  		error = -ENOMEM;
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1469  		goto error_sec_opts;
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1470  	}
8260edba67a2e6b Josef Bacik       2020-01-24  1471  	btrfs_init_fs_info(fs_info);
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1472  
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1473  	fs_info->super_copy = kzalloc(BTRFS_SUPER_INFO_SIZE, GFP_KERNEL);
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1474  	fs_info->super_for_commit = kzalloc(BTRFS_SUPER_INFO_SIZE, GFP_KERNEL);
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1475  	if (!fs_info->super_copy || !fs_info->super_for_commit) {
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1476  		error = -ENOMEM;
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1477  		goto error_fs_info;
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1478  	}
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1479  
399f7f4c42e8a58 David Sterba      2018-06-19  1480  	mutex_lock(&uuid_mutex);
2ef789288afd365 Christoph Hellwig 2023-06-08  1481  	error = btrfs_parse_device_options(data, mode);
81ffd56b5745355 David Sterba      2018-06-19  1482  	if (error) {
399f7f4c42e8a58 David Sterba      2018-06-19  1483  		mutex_unlock(&uuid_mutex);
399f7f4c42e8a58 David Sterba      2018-06-19  1484  		goto error_fs_info;
81ffd56b5745355 David Sterba      2018-06-19  1485  	}
399f7f4c42e8a58 David Sterba      2018-06-19  1486  
2ef789288afd365 Christoph Hellwig 2023-06-08  1487  	device = btrfs_scan_one_device(device_name, mode);
36350e95a2b1fee Gu Jinxiang       2018-07-12  1488  	if (IS_ERR(device)) {
399f7f4c42e8a58 David Sterba      2018-06-19  1489  		mutex_unlock(&uuid_mutex);
36350e95a2b1fee Gu Jinxiang       2018-07-12  1490  		error = PTR_ERR(device);
399f7f4c42e8a58 David Sterba      2018-06-19  1491  		goto error_fs_info;
81ffd56b5745355 David Sterba      2018-06-19  1492  	}
399f7f4c42e8a58 David Sterba      2018-06-19  1493  
36350e95a2b1fee Gu Jinxiang       2018-07-12  1494  	fs_devices = device->fs_devices;
399f7f4c42e8a58 David Sterba      2018-06-19  1495  	fs_info->fs_devices = fs_devices;
399f7f4c42e8a58 David Sterba      2018-06-19  1496  
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1497  	error = btrfs_open_devices(fs_devices, mode, fs_type);
f5194e34cabaddd David Sterba      2018-06-19  1498  	mutex_unlock(&uuid_mutex);
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1499  	if (error)
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1500  		goto error_fs_info;
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1501  
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1502  	if (!(flags & SB_RDONLY) && fs_devices->rw_devices == 0) {
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1503  		error = -EACCES;
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1504  		goto error_close_devices;
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1505  	}
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1506  
d24fa5c1da08026 Anand Jain        2021-08-24  1507  	bdev = fs_devices->latest_dev->bdev;
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1508  	s = sget(fs_type, btrfs_test_super, btrfs_set_super, flags | SB_NOSEC,
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1509  		 fs_info);
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1510  	if (IS_ERR(s)) {
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1511  		error = PTR_ERR(s);
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1512  		goto error_close_devices;
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1513  	}
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1514  
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1515  	if (s->s_root) {
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1516  		btrfs_close_devices(fs_devices);
0d4b0463011de06 Josef Bacik       2020-01-24  1517  		btrfs_free_fs_info(fs_info);
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1518  		if ((flags ^ s->s_flags) & SB_RDONLY)
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1519  			error = -EBUSY;
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1520  	} else {
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1521  		snprintf(s->s_id, sizeof(s->s_id), "%pg", bdev);
e33c267ab70de42 Roman Gushchin    2022-05-31  1522  		shrinker_debugfs_rename(&s->s_shrink, "sb-%s:%s", fs_type->name,
e33c267ab70de42 Roman Gushchin    2022-05-31  1523  					s->s_id);
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1524  		btrfs_sb(s)->bdev_holder = fs_type;
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1525  		error = btrfs_fill_super(s, fs_devices, data);
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1526  	}
a65001e8a4d4656 Al Viro           2018-12-10  1527  	if (!error)
204cc0ccf1d49c6 Al Viro           2018-12-13 @1528  		error = security_sb_set_mnt_opts(s, new_sec_opts, 0, NULL);
a65001e8a4d4656 Al Viro           2018-12-10 @1529  	security_free_mnt_opts(&new_sec_opts);
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1530  	if (error) {
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1531  		deactivate_locked_super(s);
a65001e8a4d4656 Al Viro           2018-12-10  1532  		return ERR_PTR(error);
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1533  	}
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1534  
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1535  	return dget(s->s_root);
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1536  
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1537  error_close_devices:
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1538  	btrfs_close_devices(fs_devices);
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1539  error_fs_info:
0d4b0463011de06 Josef Bacik       2020-01-24  1540  	btrfs_free_fs_info(fs_info);
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1541  error_sec_opts:
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1542  	security_free_mnt_opts(&new_sec_opts);
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1543  	return ERR_PTR(error);
72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1544  }
312c89fbca06896 Misono, Tomohiro  2017-12-14  1545
Johannes Thumshirn Aug. 28, 2023, 11:08 a.m. UTC | #2
On 25.08.23 16:23, kernel test robot wrote:
> Hi Josef,
> 
> kernel test robot noticed the following build errors:
> 
> [auto build test ERROR on kdave/for-next]
> [also build test ERROR on next-20230825]
> [cannot apply to linus/master v6.5-rc7]
> [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/Josef-Bacik/btrfs-move-btrfs_crc32c_final-into-free-space-cache-c/20230823-215354
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
> patch link:    https://lore.kernel.org/r/ed1caf5b26573e62547cb3b96031af66c0f082ca.1692798556.git.josef%40toxicpanda.com
> patch subject: [PATCH 11/11] btrfs: remove extraneous includes from ctree.h
> config: arc-randconfig-001-20230824 (https://download.01.org/0day-ci/archive/20230825/202308252218.ReiikzVx-lkp@intel.com/config)
> compiler: arc-elf-gcc (GCC) 13.2.0
> reproduce: (https://download.01.org/0day-ci/archive/20230825/202308252218.ReiikzVx-lkp@intel.com/reproduce)


Looks like #include <linux/security.h> is missing in super.c


> 
> 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/202308252218.ReiikzVx-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
>     fs/btrfs/super.c: In function 'btrfs_mount_root':
>>> fs/btrfs/super.c:1453:25: error: implicit declaration of function 'security_sb_eat_lsm_opts' [-Werror=implicit-function-declaration]
>      1453 |                 error = security_sb_eat_lsm_opts(data, &new_sec_opts);
>           |                         ^~~~~~~~~~~~~~~~~~~~~~~~
>>> fs/btrfs/super.c:1528:25: error: implicit declaration of function 'security_sb_set_mnt_opts' [-Werror=implicit-function-declaration]
>      1528 |                 error = security_sb_set_mnt_opts(s, new_sec_opts, 0, NULL);
>           |                         ^~~~~~~~~~~~~~~~~~~~~~~~
>>> fs/btrfs/super.c:1529:9: error: implicit declaration of function 'security_free_mnt_opts' [-Werror=implicit-function-declaration]
>      1529 |         security_free_mnt_opts(&new_sec_opts);
>           |         ^~~~~~~~~~~~~~~~~~~~~~
>     fs/btrfs/super.c: In function 'btrfs_remount':
>>> fs/btrfs/super.c:1704:31: error: implicit declaration of function 'security_sb_remount' [-Werror=implicit-function-declaration]
>      1704 |                         ret = security_sb_remount(sb, new_sec_opts);
>           |                               ^~~~~~~~~~~~~~~~~~~
>     cc1: some warnings being treated as errors
> 
> 
> vim +/security_sb_eat_lsm_opts +1453 fs/btrfs/super.c
> 
> 450ba0ea06b6ed3 Josef Bacik       2010-11-19  1433
> 312c89fbca06896 Misono, Tomohiro  2017-12-14  1434  /*
> 312c89fbca06896 Misono, Tomohiro  2017-12-14  1435   * Find a superblock for the given device / mount point.
> 312c89fbca06896 Misono, Tomohiro  2017-12-14  1436   *
> 312c89fbca06896 Misono, Tomohiro  2017-12-14  1437   * Note: This is based on mount_bdev from fs/super.c with a few additions
> 312c89fbca06896 Misono, Tomohiro  2017-12-14  1438   *       for multiple device setup.  Make sure to keep it in sync.
> 312c89fbca06896 Misono, Tomohiro  2017-12-14  1439   */
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1440  static struct dentry *btrfs_mount_root(struct file_system_type *fs_type,
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1441  		int flags, const char *device_name, void *data)
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1442  {
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1443  	struct block_device *bdev = NULL;
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1444  	struct super_block *s;
> 36350e95a2b1fee Gu Jinxiang       2018-07-12  1445  	struct btrfs_device *device = NULL;
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1446  	struct btrfs_fs_devices *fs_devices = NULL;
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1447  	struct btrfs_fs_info *fs_info = NULL;
> 204cc0ccf1d49c6 Al Viro           2018-12-13  1448  	void *new_sec_opts = NULL;
> 05bdb9965305bbf Christoph Hellwig 2023-06-08  1449  	blk_mode_t mode = sb_open_mode(flags);
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1450  	int error = 0;
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1451
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1452  	if (data) {
> a65001e8a4d4656 Al Viro           2018-12-10 @1453  		error = security_sb_eat_lsm_opts(data, &new_sec_opts);
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1454  		if (error)
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1455  			return ERR_PTR(error);
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1456  	}
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1457
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1458  	/*
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1459  	 * Setup a dummy root and fs_info for test/set super.  This is because
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1460  	 * we don't actually fill this stuff out until open_ctree, but we need
> 8260edba67a2e6b Josef Bacik       2020-01-24  1461  	 * then open_ctree will properly initialize the file system specific
> 8260edba67a2e6b Josef Bacik       2020-01-24  1462  	 * settings later.  btrfs_init_fs_info initializes the static elements
> 8260edba67a2e6b Josef Bacik       2020-01-24  1463  	 * of the fs_info (locks and such) to make cleanup easier if we find a
> 8260edba67a2e6b Josef Bacik       2020-01-24  1464  	 * superblock with our given fs_devices later on at sget() time.
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1465  	 */
> a8fd1f71749387c Jeff Mahoney      2018-02-15  1466  	fs_info = kvzalloc(sizeof(struct btrfs_fs_info), GFP_KERNEL);
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1467  	if (!fs_info) {
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1468  		error = -ENOMEM;
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1469  		goto error_sec_opts;
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1470  	}
> 8260edba67a2e6b Josef Bacik       2020-01-24  1471  	btrfs_init_fs_info(fs_info);
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1472
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1473  	fs_info->super_copy = kzalloc(BTRFS_SUPER_INFO_SIZE, GFP_KERNEL);
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1474  	fs_info->super_for_commit = kzalloc(BTRFS_SUPER_INFO_SIZE, GFP_KERNEL);
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1475  	if (!fs_info->super_copy || !fs_info->super_for_commit) {
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1476  		error = -ENOMEM;
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1477  		goto error_fs_info;
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1478  	}
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1479
> 399f7f4c42e8a58 David Sterba      2018-06-19  1480  	mutex_lock(&uuid_mutex);
> 2ef789288afd365 Christoph Hellwig 2023-06-08  1481  	error = btrfs_parse_device_options(data, mode);
> 81ffd56b5745355 David Sterba      2018-06-19  1482  	if (error) {
> 399f7f4c42e8a58 David Sterba      2018-06-19  1483  		mutex_unlock(&uuid_mutex);
> 399f7f4c42e8a58 David Sterba      2018-06-19  1484  		goto error_fs_info;
> 81ffd56b5745355 David Sterba      2018-06-19  1485  	}
> 399f7f4c42e8a58 David Sterba      2018-06-19  1486
> 2ef789288afd365 Christoph Hellwig 2023-06-08  1487  	device = btrfs_scan_one_device(device_name, mode);
> 36350e95a2b1fee Gu Jinxiang       2018-07-12  1488  	if (IS_ERR(device)) {
> 399f7f4c42e8a58 David Sterba      2018-06-19  1489  		mutex_unlock(&uuid_mutex);
> 36350e95a2b1fee Gu Jinxiang       2018-07-12  1490  		error = PTR_ERR(device);
> 399f7f4c42e8a58 David Sterba      2018-06-19  1491  		goto error_fs_info;
> 81ffd56b5745355 David Sterba      2018-06-19  1492  	}
> 399f7f4c42e8a58 David Sterba      2018-06-19  1493
> 36350e95a2b1fee Gu Jinxiang       2018-07-12  1494  	fs_devices = device->fs_devices;
> 399f7f4c42e8a58 David Sterba      2018-06-19  1495  	fs_info->fs_devices = fs_devices;
> 399f7f4c42e8a58 David Sterba      2018-06-19  1496
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1497  	error = btrfs_open_devices(fs_devices, mode, fs_type);
> f5194e34cabaddd David Sterba      2018-06-19  1498  	mutex_unlock(&uuid_mutex);
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1499  	if (error)
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1500  		goto error_fs_info;
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1501
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1502  	if (!(flags & SB_RDONLY) && fs_devices->rw_devices == 0) {
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1503  		error = -EACCES;
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1504  		goto error_close_devices;
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1505  	}
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1506
> d24fa5c1da08026 Anand Jain        2021-08-24  1507  	bdev = fs_devices->latest_dev->bdev;
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1508  	s = sget(fs_type, btrfs_test_super, btrfs_set_super, flags | SB_NOSEC,
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1509  		 fs_info);
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1510  	if (IS_ERR(s)) {
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1511  		error = PTR_ERR(s);
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1512  		goto error_close_devices;
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1513  	}
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1514
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1515  	if (s->s_root) {
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1516  		btrfs_close_devices(fs_devices);
> 0d4b0463011de06 Josef Bacik       2020-01-24  1517  		btrfs_free_fs_info(fs_info);
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1518  		if ((flags ^ s->s_flags) & SB_RDONLY)
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1519  			error = -EBUSY;
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1520  	} else {
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1521  		snprintf(s->s_id, sizeof(s->s_id), "%pg", bdev);
> e33c267ab70de42 Roman Gushchin    2022-05-31  1522  		shrinker_debugfs_rename(&s->s_shrink, "sb-%s:%s", fs_type->name,
> e33c267ab70de42 Roman Gushchin    2022-05-31  1523  					s->s_id);
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1524  		btrfs_sb(s)->bdev_holder = fs_type;
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1525  		error = btrfs_fill_super(s, fs_devices, data);
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1526  	}
> a65001e8a4d4656 Al Viro           2018-12-10  1527  	if (!error)
> 204cc0ccf1d49c6 Al Viro           2018-12-13 @1528  		error = security_sb_set_mnt_opts(s, new_sec_opts, 0, NULL);
> a65001e8a4d4656 Al Viro           2018-12-10 @1529  	security_free_mnt_opts(&new_sec_opts);
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1530  	if (error) {
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1531  		deactivate_locked_super(s);
> a65001e8a4d4656 Al Viro           2018-12-10  1532  		return ERR_PTR(error);
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1533  	}
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1534
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1535  	return dget(s->s_root);
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1536
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1537  error_close_devices:
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1538  	btrfs_close_devices(fs_devices);
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1539  error_fs_info:
> 0d4b0463011de06 Josef Bacik       2020-01-24  1540  	btrfs_free_fs_info(fs_info);
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1541  error_sec_opts:
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1542  	security_free_mnt_opts(&new_sec_opts);
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1543  	return ERR_PTR(error);
> 72fa39f5c7a1c9d Misono, Tomohiro  2017-12-14  1544  }
> 312c89fbca06896 Misono, Tomohiro  2017-12-14  1545
>
Josef Bacik Aug. 28, 2023, 1:29 p.m. UTC | #3
On Mon, Aug 28, 2023 at 11:08:46AM +0000, Johannes Thumshirn wrote:
> On 25.08.23 16:23, kernel test robot wrote:
> > Hi Josef,
> > 
> > kernel test robot noticed the following build errors:
> > 
> > [auto build test ERROR on kdave/for-next]
> > [also build test ERROR on next-20230825]
> > [cannot apply to linus/master v6.5-rc7]
> > [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/Josef-Bacik/btrfs-move-btrfs_crc32c_final-into-free-space-cache-c/20230823-215354
> > base:   https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
> > patch link:    https://lore.kernel.org/r/ed1caf5b26573e62547cb3b96031af66c0f082ca.1692798556.git.josef%40toxicpanda.com
> > patch subject: [PATCH 11/11] btrfs: remove extraneous includes from ctree.h
> > config: arc-randconfig-001-20230824 (https://download.01.org/0day-ci/archive/20230825/202308252218.ReiikzVx-lkp@intel.com/config)
> > compiler: arc-elf-gcc (GCC) 13.2.0
> > reproduce: (https://download.01.org/0day-ci/archive/20230825/202308252218.ReiikzVx-lkp@intel.com/reproduce)
> 
> 
> Looks like #include <linux/security.h> is missing in super.c
> 

Yup I fixed it in v2 I sent on Friday.  Thanks,

Josef
diff mbox series

Patch

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 9c2e96b8711f..da9e07bf76ea 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -6,36 +6,8 @@ 
 #ifndef BTRFS_CTREE_H
 #define BTRFS_CTREE_H
 
-#include <linux/mm.h>
-#include <linux/sched/signal.h>
-#include <linux/highmem.h>
-#include <linux/fs.h>
-#include <linux/rwsem.h>
-#include <linux/semaphore.h>
-#include <linux/completion.h>
-#include <linux/backing-dev.h>
-#include <linux/wait.h>
-#include <linux/slab.h>
-#include <trace/events/btrfs.h>
-#include <asm/unaligned.h>
 #include <linux/pagemap.h>
-#include <linux/btrfs.h>
-#include <linux/btrfs_tree.h>
-#include <linux/workqueue.h>
-#include <linux/security.h>
-#include <linux/sizes.h>
-#include <linux/dynamic_debug.h>
-#include <linux/refcount.h>
-#include <linux/crc32c.h>
-#include <linux/iomap.h>
-#include <linux/fscrypt.h>
-#include "extent-io-tree.h"
-#include "extent_io.h"
-#include "extent_map.h"
-#include "async-thread.h"
-#include "block-rsv.h"
 #include "locking.h"
-#include "misc.h"
 #include "fs.h"
 
 struct btrfs_trans_handle;