Re: [PATCH 2/2] dax: fix data corruption due to stale mmap reads

2017-05-04 Thread Jan Kara
On Mon 01-05-17 16:38:55, Ross Zwisler wrote: > > So for now I'm still more inclined to just stay with the radix tree lock as > > is and just fix up the locking as I suggest and go for larger rewrite only > > if we can demonstrate further performance wins. > > Sounds good. > > > WRT your second

Re: [PATCH 2/2] dax: fix data corruption due to stale mmap reads

2017-05-04 Thread Jan Kara
On Mon 01-05-17 16:38:55, Ross Zwisler wrote: > > So for now I'm still more inclined to just stay with the radix tree lock as > > is and just fix up the locking as I suggest and go for larger rewrite only > > if we can demonstrate further performance wins. > > Sounds good. > > > WRT your second

Re: [PATCH 2/2] dax: fix data corruption due to stale mmap reads

2017-05-01 Thread Dan Williams
On Thu, Apr 27, 2017 at 12:26 AM, Jan Kara wrote: > On Wed 26-04-17 16:52:36, Ross Zwisler wrote: >> On Wed, Apr 26, 2017 at 10:52:35AM +0200, Jan Kara wrote: >> > On Tue 25-04-17 16:59:36, Ross Zwisler wrote: >> > > On Tue, Apr 25, 2017 at 01:10:43PM +0200, Jan Kara wrote: >> > >

Re: [PATCH 2/2] dax: fix data corruption due to stale mmap reads

2017-05-01 Thread Dan Williams
On Thu, Apr 27, 2017 at 12:26 AM, Jan Kara wrote: > On Wed 26-04-17 16:52:36, Ross Zwisler wrote: >> On Wed, Apr 26, 2017 at 10:52:35AM +0200, Jan Kara wrote: >> > On Tue 25-04-17 16:59:36, Ross Zwisler wrote: >> > > On Tue, Apr 25, 2017 at 01:10:43PM +0200, Jan Kara wrote: >> > > <> >> > > >

Re: [PATCH 2/2] dax: fix data corruption due to stale mmap reads

2017-05-01 Thread Ross Zwisler
On Thu, Apr 27, 2017 at 09:26:59AM +0200, Jan Kara wrote: > On Wed 26-04-17 16:52:36, Ross Zwisler wrote: <> > > I don't think this alone is enough to save us. The I/O path doesn't > > currently > > take any DAX radix tree entry locks, so our race would just become: > > > > CPU1 - write(2)

Re: [PATCH 2/2] dax: fix data corruption due to stale mmap reads

2017-05-01 Thread Ross Zwisler
On Thu, Apr 27, 2017 at 09:26:59AM +0200, Jan Kara wrote: > On Wed 26-04-17 16:52:36, Ross Zwisler wrote: <> > > I don't think this alone is enough to save us. The I/O path doesn't > > currently > > take any DAX radix tree entry locks, so our race would just become: > > > > CPU1 - write(2)

Re: [PATCH 2/2] dax: fix data corruption due to stale mmap reads

2017-04-27 Thread Jan Kara
On Wed 26-04-17 16:52:36, Ross Zwisler wrote: > On Wed, Apr 26, 2017 at 10:52:35AM +0200, Jan Kara wrote: > > On Tue 25-04-17 16:59:36, Ross Zwisler wrote: > > > On Tue, Apr 25, 2017 at 01:10:43PM +0200, Jan Kara wrote: > > > <> > > > > Hum, but now thinking more about it I have hard time figuring

Re: [PATCH 2/2] dax: fix data corruption due to stale mmap reads

2017-04-27 Thread Jan Kara
On Wed 26-04-17 16:52:36, Ross Zwisler wrote: > On Wed, Apr 26, 2017 at 10:52:35AM +0200, Jan Kara wrote: > > On Tue 25-04-17 16:59:36, Ross Zwisler wrote: > > > On Tue, Apr 25, 2017 at 01:10:43PM +0200, Jan Kara wrote: > > > <> > > > > Hum, but now thinking more about it I have hard time figuring

Re: [PATCH 2/2] dax: fix data corruption due to stale mmap reads

2017-04-26 Thread Ross Zwisler
On Wed, Apr 26, 2017 at 10:52:35AM +0200, Jan Kara wrote: > On Tue 25-04-17 16:59:36, Ross Zwisler wrote: > > On Tue, Apr 25, 2017 at 01:10:43PM +0200, Jan Kara wrote: > > <> > > > Hum, but now thinking more about it I have hard time figuring out why > > > write > > > vs fault cannot actually

Re: [PATCH 2/2] dax: fix data corruption due to stale mmap reads

2017-04-26 Thread Ross Zwisler
On Wed, Apr 26, 2017 at 10:52:35AM +0200, Jan Kara wrote: > On Tue 25-04-17 16:59:36, Ross Zwisler wrote: > > On Tue, Apr 25, 2017 at 01:10:43PM +0200, Jan Kara wrote: > > <> > > > Hum, but now thinking more about it I have hard time figuring out why > > > write > > > vs fault cannot actually

Re: [PATCH 2/2] dax: fix data corruption due to stale mmap reads

2017-04-26 Thread Jan Kara
On Tue 25-04-17 16:59:36, Ross Zwisler wrote: > On Tue, Apr 25, 2017 at 01:10:43PM +0200, Jan Kara wrote: > <> > > Hum, but now thinking more about it I have hard time figuring out why write > > vs fault cannot actually still race: > > > > CPU1 - write(2) CPU2 - read

Re: [PATCH 2/2] dax: fix data corruption due to stale mmap reads

2017-04-26 Thread Jan Kara
On Tue 25-04-17 16:59:36, Ross Zwisler wrote: > On Tue, Apr 25, 2017 at 01:10:43PM +0200, Jan Kara wrote: > <> > > Hum, but now thinking more about it I have hard time figuring out why write > > vs fault cannot actually still race: > > > > CPU1 - write(2) CPU2 - read

Re: [PATCH 2/2] dax: fix data corruption due to stale mmap reads

2017-04-25 Thread Ross Zwisler
On Tue, Apr 25, 2017 at 01:10:43PM +0200, Jan Kara wrote: <> > Hum, but now thinking more about it I have hard time figuring out why write > vs fault cannot actually still race: > > CPU1 - write(2) CPU2 - read fault > >

Re: [PATCH 2/2] dax: fix data corruption due to stale mmap reads

2017-04-25 Thread Ross Zwisler
On Tue, Apr 25, 2017 at 01:10:43PM +0200, Jan Kara wrote: <> > Hum, but now thinking more about it I have hard time figuring out why write > vs fault cannot actually still race: > > CPU1 - write(2) CPU2 - read fault > >

Re: [PATCH 2/2] dax: fix data corruption due to stale mmap reads

2017-04-25 Thread Jan Kara
On Thu 20-04-17 21:44:37, Ross Zwisler wrote: > Users of DAX can suffer data corruption from stale mmap reads via the > following sequence: > > - open an mmap over a 2MiB hole > > - read from a 2MiB hole, faulting in a 2MiB zero page > > - write to the hole with write(3p). The write succeeds

Re: [PATCH 2/2] dax: fix data corruption due to stale mmap reads

2017-04-25 Thread Jan Kara
On Thu 20-04-17 21:44:37, Ross Zwisler wrote: > Users of DAX can suffer data corruption from stale mmap reads via the > following sequence: > > - open an mmap over a 2MiB hole > > - read from a 2MiB hole, faulting in a 2MiB zero page > > - write to the hole with write(3p). The write succeeds

[PATCH 2/2] dax: fix data corruption due to stale mmap reads

2017-04-20 Thread Ross Zwisler
Users of DAX can suffer data corruption from stale mmap reads via the following sequence: - open an mmap over a 2MiB hole - read from a 2MiB hole, faulting in a 2MiB zero page - write to the hole with write(3p). The write succeeds but we incorrectly leave the 2MiB zero page mapping intact.

[PATCH 2/2] dax: fix data corruption due to stale mmap reads

2017-04-20 Thread Ross Zwisler
Users of DAX can suffer data corruption from stale mmap reads via the following sequence: - open an mmap over a 2MiB hole - read from a 2MiB hole, faulting in a 2MiB zero page - write to the hole with write(3p). The write succeeds but we incorrectly leave the 2MiB zero page mapping intact.