From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gabriel de Perthuis Subject: linear writes on read-only zero devices, any alternatives? Date: Sun, 3 Mar 2013 11:36:23 +0000 (UTC) Message-ID: Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: dm-devel@redhat.com List-Id: dm-devel.ids Hello, I'm trying to build a block device with a small writable area (a loopback device) and a large read-only area full of zeroes. Stacking a read-only zero device doesn't work, because linear writes to it anyway (tested in 3.8.1, steps below). It seems to be a bug, but in case it isn't or can't be fixed, could one of the dm targets (linear, error, or zero) get a read-only flag that ensures that writes do fail? Test case: sudo dmsetup create --readonly --table '0 1024 zero' rozero sudo dmsetup create --table '0 1024 linear /dev/mapper/rozero 0' synthetic sudo dd if=/dev/urandom of=/dev/mapper/synthetic bs=512 count=1024