Re: [PATCH] Add WRITE_ATOMIC_16 support

FUJITA Tomonori <[email protected]> Tue, 15 Sep 2015 18:54:32 +0900 (JST)
Newsgroups org.kernel.vger.stgt
Message-ID <[email protected]>
On Wed,  9 Sep 2015 11:43:54 -0700
Ronnie Sahlberg <[email protected]> wrote:

> Please find attached a patch that adds support for the new opcode
> WRITE_ATOMIC_16 to the bs_rdwr backend.
> 
> I try to make it as atomic as possible by using mmap and mlock to ensure that
> both the write buffer and the file region we are writing to will be all
> present and locked down in memory before I just memcpy() the data.
> At that stage it is then assumed that the memcpy() will never fail short.

But it's still possible that the data written to the underlying file
system in 'non-atomic' manner in the case of linux kernel crash or
such?