[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Nbd] [PATCH] fix documentation of NBD_CMD_FLUSH



Alex Bligh <alex@...872...> writes:

> Goswin,
>
> --On 22 May 2011 00:02:44 +0200 Goswin von Brederlow
> <goswin-v-b@...186...> wrote:
>
>> Wouldn't it make sense to allow offset and length to flush only parts of
>> an NBD device? offset == length == 0 could be an alias for the whole
>> disk.
>
> One could do that. Currently the NBD_CMD_FLUSH implementation is
> modeled on Linux's REQ_FLUSH, which is a whole device command.
> Are there other users of nbd-server which would benefit from
> such a partial flush? You also end up with a question as to whether

I was thinking of what would be the best when you have for example lvm
on nbd or the nbd is mmaped and msync is called. It could be possible to
improves Linux to preserve the range.

> you would flush the metadata or no (fsync() flushes metadata
> but sync_file_range dones not).

That should probably be a server option dependend on the filesystem in
use. With ext2/3/4 there is no need to flush metadata unless the backing
file is sparse for example.

But nbd-server needs to know about that to emulate FUA.

MfG
        Goswin



Reply to: