Skip to content

Commit 8163496

Browse files
bcodding-rhJ. Bruce Fields
authored andcommitted
nfsd: don't advertise a SCSI layout for an unsupported request_queue
Commit 30181fa ("nfsd: Check queue type before submitting a SCSI request") did the work of ensuring that we don't send SCSI requests to a request queue that won't support them, but that check is in the GETDEVICEINFO path. Let's not set the SCSI layout in fs_layout_type in the first place, and then we'll have less clients sending GETDEVICEINFO for non-SCSI request queues and less unnecessary WARN_ONs. While we're in here, remove some outdated comments that refer to "overwriting" layout seletion because commit 8a4c392 ("nfsd: allow nfsd to advertise multiple layout types") changed things to no longer overwrite the layout type. Signed-off-by: Benjamin Coddington <bcodding@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
1 parent 5b7b15a commit 8163496

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

‎fs/nfsd/nfs4layouts.c‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,27 +133,20 @@ void nfsd4_setup_layout_type(struct svc_export *exp)
133133
if (!(exp->ex_flags & NFSEXP_PNFS))
134134
return;
135135

136-
/*
137-
* If flex file is configured, use it by default. Otherwise
138-
* check if the file system supports exporting a block-like layout.
139-
* If the block device supports reservations prefer the SCSI layout,
140-
* otherwise advertise the block layout.
141-
*/
142136
#ifdef CONFIG_NFSD_FLEXFILELAYOUT
143137
exp->ex_layout_types |= 1 << LAYOUT_FLEX_FILES;
144138
#endif
145139
#ifdef CONFIG_NFSD_BLOCKLAYOUT
146-
/* overwrite flex file layout selection if needed */
147140
if (sb->s_export_op->get_uuid &&
148141
sb->s_export_op->map_blocks &&
149142
sb->s_export_op->commit_blocks)
150143
exp->ex_layout_types |= 1 << LAYOUT_BLOCK_VOLUME;
151144
#endif
152145
#ifdef CONFIG_NFSD_SCSILAYOUT
153-
/* overwrite block layout selection if needed */
154146
if (sb->s_export_op->map_blocks &&
155147
sb->s_export_op->commit_blocks &&
156-
sb->s_bdev && sb->s_bdev->bd_disk->fops->pr_ops)
148+
sb->s_bdev && sb->s_bdev->bd_disk->fops->pr_ops &&
149+
blk_queue_scsi_passthrough(sb->s_bdev->bd_disk->queue))
157150
exp->ex_layout_types |= 1 << LAYOUT_SCSI;
158151
#endif
159152
}

0 commit comments

Comments
 (0)