linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO
@ 2012-07-20 16:30 Paolo Bonzini
  2012-08-01 15:53 ` Paolo Bonzini
  2012-09-11 16:59 ` Tejun Heo
  0 siblings, 2 replies; 24+ messages in thread
From: Paolo Bonzini @ 2012-07-20 16:30 UTC (permalink / raw)
  To: linux-kernel; +Cc: axboe, linux-scsi

These commands cannot be issued right now without giving CAP_SYS_RAWIO to
the process who wishes to send them.  These commands can be useful also to
non-privileged programs who have access to the block devices.  For example
a virtual machine monitor needs them to forward trim/discard to host disks.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 block/scsi_ioctl.c |    3 ++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index 260fa80..dd71f18 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -168,13 +168,16 @@ static void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter)
 	/* Basic writing commands */
 	__set_bit(WRITE_6, filter->write_ok);
 	__set_bit(WRITE_10, filter->write_ok);
+	__set_bit(WRITE_SAME, filter->write_ok);
 	__set_bit(WRITE_VERIFY, filter->write_ok);
 	__set_bit(WRITE_12, filter->write_ok);
 	__set_bit(WRITE_VERIFY_12, filter->write_ok);
 	__set_bit(WRITE_16, filter->write_ok);
+	__set_bit(WRITE_SAME_16, filter->write_ok);
 	__set_bit(WRITE_LONG, filter->write_ok);
 	__set_bit(WRITE_LONG_2, filter->write_ok);
 	__set_bit(ERASE, filter->write_ok);
+	__set_bit(UNMAP, filter->write_ok);
 	__set_bit(GPCMD_MODE_SELECT_10, filter->write_ok);
 	__set_bit(MODE_SELECT, filter->write_ok);
 	__set_bit(LOG_SELECT, filter->write_ok);

^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2012-09-12  8:18 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-20 16:30 [PATCH] sg_io: allow UNMAP and WRITE SAME without CAP_SYS_RAWIO Paolo Bonzini
2012-08-01 15:53 ` Paolo Bonzini
2012-08-28 11:04   ` Paolo Bonzini
2012-09-05 14:41     ` [Ping^3] " Paolo Bonzini
2012-09-05 20:18       ` Ric Wheeler
2012-09-06  6:31         ` Paolo Bonzini
2012-09-06 11:31           ` Ric Wheeler
2012-09-06 11:49             ` Paolo Bonzini
2012-09-06 12:08               ` Ric Wheeler
2012-09-06 12:36                 ` Paolo Bonzini
2012-09-06 14:20                   ` Lukáš Czerner
2012-09-11 16:59 ` Tejun Heo
2012-09-11 17:56   ` Paolo Bonzini
2012-09-11 18:29     ` Tejun Heo
2012-09-11 18:54       ` Paolo Bonzini
2012-09-11 19:13         ` Tejun Heo
2012-09-11 19:24           ` Paolo Bonzini
2012-09-11 20:01             ` Tejun Heo
2012-09-11 21:50               ` Paolo Bonzini
2012-09-11 22:02                 ` Tejun Heo
2012-09-11 22:10                   ` Paolo Bonzini
2012-09-11 22:13                     ` Tejun Heo
2012-09-12  8:05     ` James Bottomley
2012-09-12  8:18       ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).