Skip to contentSkip to conversation

block: remove dead code in scsi_ioctl:blk_verify_command

PATCH Dave Jones 2 participants 2 messages May 29, 2014

Subsystems (2)
lore
Share & tools
lore

Dave Jones

author
#0 lore raw

filter gets assigned the address of blk_default_cmd_filter on entry to this function, so the !filter condition can never be true.

block/scsi_ioctl.c +0 -4
index 26487972ac54..9c28a5b38042 100644
@@ -205,10 +205,6 @@ int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm)
 	if (capable(CAP_SYS_RAWIO))
 		return 0;
 
-	/* if there's no filter set, assume we're filtering everything out */
-	if (!filter)
-		return -EPERM;
-
 	/* Anybody who can open the device can do a read-safe command */
 	if (test_bit(cmd[0], filter->read_ok))
 		return 0;
maintainer
#1 lore raw
Quoted 10 lines · Dave Jones

filter gets assigned the address of blk_default_cmd_filter on entry to this function, so the !filter condition can never be true.

block/scsi_ioctl.c +0 -0
index 26487972ac54..9c28a5b38042 100644

block/scsi_ioctl.c int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm) · line 210

Quoted 10 lines
block/scsi_ioctl.c +0 -4
@@ -205,10 +205,6 @@ int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm)
 	if (capable(CAP_SYS_RAWIO))
 		return 0;
 
-	/* if there's no filter set, assume we're filtering everything out */
-	if (!filter)
-		return -EPERM;
-
 	/* Anybody who can open the device can do a read-safe command */
 	if (test_bit(cmd[0], filter->read_ok))
 		return 0;

Thanks Dave, applied.

Signature · 1 line
Jens Axboe