Re: [f2fs-dev] [PATCH] f2fs crypto: add rwsem to avoid data races

From: Theodore Ts'o
Date: Wed May 20 2015 - 00:35:49 EST


On Tue, May 19, 2015 at 05:38:59PM -0700, Jaegeuk Kim wrote:
>
> What I'm saying is writer vs writer actually.

This is a rough draft of what I had in mind. This fixes the tfm
allocation issue in the writepage path, as well as using a lockless
cmpxchg algorithm to address the race you were concerned about.

What do you think? I'm still running xfstests, and I want to do
another desk check of the code tomorrow after I get a good night's
sleep, but it does pass my quick smoketest script, and enough of
xfstests's quick test group that any bugs left are probably the more
subtle ones.

- Ted