Re: [PATCH 1/1] fscache: Fix oops due to race with cookie_lru and use_cookie

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

 



Dave Wysochanski <dwysocha@xxxxxxxxxx> wrote:

> If a cookie expires from the LRU and the LRU_DISCARD flag is set,
> but the state machine has not run yet, it's possible another thread
> can call fscache_use_cookie and begin to use it.  When the
> cookie_worker finally runs, it will see the LRU_DISCARD flag set,
> transition the cookie->state to LRU_DISCARDING, which will then
> withdraw the cookie.  Once the cookie is withdrawn the object is
> removed the below oops will occur because the object associated
> with the cookie is now NULL.
> 
> Fix the oops by clearing the LRU_DISCARD bit if another thread
> uses the cookie before the cookie_worker runs.

I think this is the right approach.  The state machine should just fall
through without doing anything, despite having been woken.

David




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux