Re: [Nbd] local mounted readonly and exported read write
- To: Wouter Verhelst <w@...112...>
- Cc: nbd-general@lists.sourceforge.net
- Subject: Re: [Nbd] local mounted readonly and exported read write
- From: Goswin von Brederlow <goswin-v-b@...186...>
- Date: Fri, 27 Apr 2012 11:05:09 +0200
- Message-id: <87wr518rzu.fsf@...860...>
- In-reply-to: <20120425193029.GG14831@...3...> (Wouter Verhelst's message of "Wed, 25 Apr 2012 21:30:29 +0200")
- References: <CAGmni9qGzq6Npba7QT4vZWK5n-tgh7mdn7F0efbeCGW6zc91Xg@...18...> <20120425193029.GG14831@...3...>
Wouter Verhelst <w@...112...> writes:
> On Tue, Apr 10, 2012 at 11:18:05AM -0300, Salatiel Filho wrote:
>> Hi guys , i have a doubt.
>> If i have a device , let's say /dev/sdb2 which is mounted locally read
>> only, and this same device is exported using nbd , and mounted
>> readwrite by the client. If the client writes to the Filesystem , this
>> can lead to data corruption ?
>
> Yes, as in, "reads from /dev/sdb2 on the server will probably only get
> you garbage after a while". This is because there's nothing in nbd
> telling the filesystem layer that things have changed in the block
> device it's working with, and that the data it's cached is no longer
> valid.
Worse it can potentially lead to kernel oopses and crash your system.
> There are filesystems who are written to support such a mode of
> operation (e.g., GFS2), but don't try this with "normal" filesystems
> like ext4.
>
> Also, note that "mount -o ro" will still try to write to the filesystem
> if the journal is dirty. Arguably this is a bug in the kernel.
Thereby also endangering the client that has it mounted read-write.
>> Or the local filesystem will just be unable to see the changes until
>> it is remounted ?
>
> No, it doesn't work that way.
MfG
Goswin
Reply to: