[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8760idyxy8.fsf@notabene.neil.brown.name>
Date: Mon, 10 Apr 2017 09:15:43 +1000
From: NeilBrown <neilb@...e.com>
To: Jeff Layton <jlayton@...hat.com>,
Matthew Wilcox <willy@...radead.org>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-ext4@...r.kernel.org, akpm@...ux-foundation.org,
tytso@....edu, jack@...e.cz
Subject: Re: [RFC PATCH 0/4] fs: introduce new writeback error tracking infrastructure and convert ext4 to use it
On Fri, Apr 07 2017, Jeff Layton wrote:
>
>> ... and then there's no need to update if it's the same errno and nobody's
>> seen it:
>>
>> if (old == new)
>> break;
>>
>
> No, we can't do this. The thing could have just been updated by a task
> that is setting the "seen" bit. We don't want to lose the error here. We
> always have to do the cmpxchg on the set_wb_error side, I think.
I don't follow your logic.
If (old == new) then there was a moment since this function started when
performing the cmpxchg() would not have changed the contents of memory.
So let's pretend it did actually happen at that moment, and not change
memory.
If we race with a task setting the "seen" bit, then it will have seen
the error *after* the new error, that this thread is reporting, actually
happened. So the result is still correct.
Thanks,
NeilBrown
Download attachment "signature.asc" of type "application/pgp-signature" (833 bytes)
Powered by blists - more mailing lists