[zfs-discuss] zfs set readonly=on does not entirely go into read-only mode

2010-08-27 Thread Robert Milkowski
Hi, When I set readonly=on on a dataset then no new files are allowed to be created. However writes to already opened files are allowed. This is rather counter intuitive - if I set a filesystem as read-only I would expect it not to allow any modifications to it. I think it shouldn't behave

Re: [zfs-discuss] zfs set readonly=on does not entirely go into read-only mode

2010-08-27 Thread Ian Collins
On 08/28/10 11:13 AM, Robert Milkowski wrote: Hi, When I set readonly=on on a dataset then no new files are allowed to be created. However writes to already opened files are allowed. This is rather counter intuitive - if I set a filesystem as read-only I would expect it not to allow any

Re: [zfs-discuss] zfs set readonly=on does not entirely go into read-only mode

2010-08-27 Thread Ian Collins
On 08/28/10 12:05 PM, Ian Collins wrote: On 08/28/10 11:13 AM, Robert Milkowski wrote: Hi, When I set readonly=on on a dataset then no new files are allowed to be created. However writes to already opened files are allowed. This is rather counter intuitive - if I set a filesystem as

Re: [zfs-discuss] zfs set readonly=on does not entirely go into read-only mode

2010-08-27 Thread Nicolas Williams
On Sat, Aug 28, 2010 at 12:05:53PM +1200, Ian Collins wrote: Think of this from the perspective of an application. How would write failure be reported? open(2) returns EACCES if the file can not be written but there isn't a corresponding return from write(2). Any open file descriptors would

Re: [zfs-discuss] zfs set readonly=on does not entirely go into read-only mode

2010-08-27 Thread Edward Ned Harvey
From: zfs-discuss-boun...@opensolaris.org [mailto:zfs-discuss- boun...@opensolaris.org] On Behalf Of Ian Collins However writes to already opened files are allowed. Think of this from the perspective of an application. How would write failure be reported? Both very good points. But I

Re: [zfs-discuss] zfs set readonly=on does not entirely go into read-only mode

2010-08-27 Thread Ian Collins
On 08/28/10 12:45 PM, Edward Ned Harvey wrote: Another specific example ... Suppose you zfs send from a primary server to a backup server. You want the filesystems to be readonly on the backup fileserver, in order to receive incrementals. If you make a mistake, and start writing to the backup

Re: [zfs-discuss] zfs set readonly=on does not entirely go into read-only mode

2010-08-27 Thread Edward Ned Harvey
From: zfs-discuss-boun...@opensolaris.org [mailto:zfs-discuss- boun...@opensolaris.org] On Behalf Of Ian Collins so it should behave in the same way as an unmount in the presence of open files. +1 You can unmount lazy, or force, or by default, the unmount fails in the presence of open

Re: [zfs-discuss] zfs set readonly=on does not entirely go into read-only mode

2010-08-27 Thread Edward Ned Harvey
From: Ian Collins [mailto:i...@ianshome.com] On 08/28/10 12:45 PM, Edward Ned Harvey wrote: Another specific example ... Suppose you zfs send from a primary server to a backup server. You want the filesystems to be readonly on the backup fileserver, in order to receive