Message ID | 1481824098-5555-1-git-send-email-mauricfo@linux.vnet.ibm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Looks fine,
Reviewed-by: Christoph Hellwig <hch@lst.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On 12/15/2016 10:48 AM, Mauricio Faria de Oliveira wrote: > The WRITE_SAME commands are not present in the blk_default_cmd_filter > write_ok list, and thus are failed with -EPERM when the SG_IO ioctl() > is executed without CAP_SYS_RAWIO capability (e.g., unprivileged users). > [ sg_io() -> blk_fill_sghdr_rq() > blk_verify_command() -> -EPERM ] Added for 4.10, thanks.
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index 0774799..c6fee74 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c @@ -182,6 +182,9 @@ static void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter) __set_bit(WRITE_16, filter->write_ok); __set_bit(WRITE_LONG, filter->write_ok); __set_bit(WRITE_LONG_2, filter->write_ok); + __set_bit(WRITE_SAME, filter->write_ok); + __set_bit(WRITE_SAME_16, filter->write_ok); + __set_bit(WRITE_SAME_32, filter->write_ok); __set_bit(ERASE, filter->write_ok); __set_bit(GPCMD_MODE_SELECT_10, filter->write_ok); __set_bit(MODE_SELECT, filter->write_ok);