Skip to content

Commit 450b4b3

Browse files
chuckleveramschuma-ntap
authored andcommitted
nfs/blocklayout: Report only when /no/ device is found
Since commit f931d83 ("nfs/blocklayout: refactor block device opening"), an error is reported when no multi-path device is found. But this isn't a fatal error if the subsequent device open is successful. On systems without multi-path devices, this message always appears whether there is a problem or not. Instead, generate less system journal noise by reporting an error only when both open attempts fail. The new error message is more actionable since it indicates that there is a real configuration issue to be addressed. Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Benjamin Coddington <[email protected]> Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent d869da9 commit 450b4b3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

fs/nfs/blocklayout/dev.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ bl_open_path(struct pnfs_block_volume *v, const char *prefix)
369369
bdev_file = bdev_file_open_by_path(devname, BLK_OPEN_READ | BLK_OPEN_WRITE,
370370
NULL, NULL);
371371
if (IS_ERR(bdev_file)) {
372-
pr_warn("pNFS: failed to open device %s (%ld)\n",
372+
dprintk("failed to open device %s (%ld)\n",
373373
devname, PTR_ERR(bdev_file));
374374
}
375375

@@ -398,8 +398,11 @@ bl_parse_scsi(struct nfs_server *server, struct pnfs_block_dev *d,
398398
bdev_file = bl_open_path(v, "dm-uuid-mpath-0x");
399399
if (IS_ERR(bdev_file))
400400
bdev_file = bl_open_path(v, "wwn-0x");
401-
if (IS_ERR(bdev_file))
401+
if (IS_ERR(bdev_file)) {
402+
pr_warn("pNFS: no device found for volume %*phN\n",
403+
v->scsi.designator_len, v->scsi.designator);
402404
return PTR_ERR(bdev_file);
405+
}
403406
d->bdev_file = bdev_file;
404407

405408
d->len = bdev_nr_bytes(file_bdev(d->bdev_file));

0 commit comments

Comments
 (0)