Hi Sergei,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on lwn/docs-next]
[also build test ERROR on linus/master v5.11-rc7 next-20210125]
[cannot apply to dm/for-next block/for-next]
[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/Sergei-Shtepa/block-layer-interp...
base:
git://git.lwn.net/linux-2.6 docs-next
config: x86_64-rhel-8.3 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
#
https://github.com/0day-ci/linux/commit/2dbb264e739c9f95b90e4ea2a0cdb5d87...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Sergei-Shtepa/block-layer-interposer/20210209-223704
git checkout 2dbb264e739c9f95b90e4ea2a0cdb5d874628746
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Note: the linux-review/Sergei-Shtepa/block-layer-interposer/20210209-223704 HEAD
a0be3a113742b603fe383ca9a97978f9815a8283 builds fine.
It only hurts bisectibility.
All errors (new ones prefixed by >>):
drivers/md/dm.c: In function 'open_table_device':
> drivers/md/dm.c:1108:12: error: 'struct dm_dev' has no
member named 'non_exclusive'
1108 | td->dm_dev.non_exclusive =
non_exclusive;
| ^
drivers/md/dm.c: In function 'dm_get_table_device':
> drivers/md/dm.c:1157:12: error: too few arguments to function
'open_table_device'
1157 | if ((r = open_table_device(td, dev, md)))
{
| ^~~~~~~~~~~~~~~~~
drivers/md/dm.c:1079:12: note: declared here
1079 | static int open_table_device(struct table_device *td, dev_t dev,
| ^~~~~~~~~~~~~~~~~
vim +1108 drivers/md/dm.c
1075
1076 /*
1077 * Open a table device so we can use it as a map destination.
1078 */
1079 static int open_table_device(struct table_device *td, dev_t dev,
1080 struct mapped_device *md, bool non_exclusive)
1081 {
1082 struct block_device *bdev;
1083 int ret;
1084
1085 BUG_ON(td->dm_dev.bdev);
1086
1087 if (non_exclusive)
1088 bdev = blkdev_get_by_dev(dev, td->dm_dev.mode, NULL);
1089 else
1090 bdev = blkdev_get_by_dev(dev, td->dm_dev.mode | FMODE_EXCL, _dm_claim_ptr);
1091
1092 if (IS_ERR(bdev)) {
1093 ret = PTR_ERR(bdev);
1094 if (ret != -EBUSY)
1095 return ret;
1096 }
1097
1098 if (!non_exclusive) {
1099 ret = bd_link_disk_holder(bdev, dm_disk(md));
1100 if (ret) {
1101 blkdev_put(bdev, td->dm_dev.mode);
1102 return ret;
1103 }
1104 }
1105
1106 td->dm_dev.bdev = bdev;
1107 td->dm_dev.dax_dev = dax_get_by_host(bdev->bd_disk->disk_name);
1108 td->dm_dev.non_exclusive = non_exclusive;
1109 return 0;
1110 }
1111
1112 /*
1113 * Close a table device that we've been using.
1114 */
1115 static void close_table_device(struct table_device *td, struct mapped_device *md)
1116 {
1117 if (!td->dm_dev.bdev)
1118 return;
1119
1120 bd_unlink_disk_holder(td->dm_dev.bdev, dm_disk(md));
1121 blkdev_put(td->dm_dev.bdev, td->dm_dev.mode | FMODE_EXCL);
1122 put_dax(td->dm_dev.dax_dev);
1123 td->dm_dev.bdev = NULL;
1124 td->dm_dev.dax_dev = NULL;
1125 }
1126
1127 static struct table_device *find_table_device(struct list_head *l, dev_t dev,
1128 fmode_t mode)
1129 {
1130 struct table_device *td;
1131
1132 list_for_each_entry(td, l, list)
1133 if (td->dm_dev.bdev->bd_dev == dev && td->dm_dev.mode == mode)
1134 return td;
1135
1136 return NULL;
1137 }
1138
1139 int dm_get_table_device(struct mapped_device *md, dev_t dev, fmode_t mode,
1140 struct dm_dev **result)
1141 {
1142 int r;
1143 struct table_device *td;
1144
1145 mutex_lock(&md->table_devices_lock);
1146 td = find_table_device(&md->table_devices, dev, mode);
1147 if (!td) {
1148 td = kmalloc_node(sizeof(*td), GFP_KERNEL, md->numa_node_id);
1149 if (!td) {
1150 mutex_unlock(&md->table_devices_lock);
1151 return -ENOMEM;
1152 }
1153
1154 td->dm_dev.mode = mode;
1155 td->dm_dev.bdev = NULL;
1156
1157 if ((r = open_table_device(td, dev, md))) {
1158 mutex_unlock(&md->table_devices_lock);
1159 kfree(td);
1160 return r;
1161 }
1162
1163 format_dev_t(td->dm_dev.name, dev);
1164
1165 refcount_set(&td->count, 1);
1166 list_add(&td->list, &md->table_devices);
1167 } else {
1168 refcount_inc(&td->count);
1169 }
1170 mutex_unlock(&md->table_devices_lock);
1171
1172 *result = &td->dm_dev;
1173 return 0;
1174 }
1175 EXPORT_SYMBOL_GPL(dm_get_table_device);
1176
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org