Messages in this thread | | | Subject | Re: [PATCH 2/2] [RFC] fadvise: Add _VOLATILE,_ISVOLATILE, and _NONVOLATILE flags | From | John Stultz <> | Date | Thu, 16 Feb 2012 21:24:11 -0800 |
| |
On Thu, 2012-02-16 at 19:43 -0800, John Stultz wrote: > On Sun, 2012-02-12 at 13:48 +0100, Dmitry Adamushko wrote: > > > > On 10 February 2012 01:16, John Stultz <john.stultz@linaro.org> wrote: > > > +static inline void volatile_range_shrink(struct > > volatile_range *range, > > + pgoff_t start_index, pgoff_t > > end_index) > > +{ > > + size_t pre = range_size(range); > > + > > + range->range_node.start = start_index; > > + range->range_node.end = end_index; > > + > > > > I guess, here we get a whole range of races with volatile_shrink(), > > which may see inconsistent (in-the-middle-of-update) ranges > > (e.g. .start and .end). > > We should be holding the vlist_mutex to avoid any such races. But you > also make clear that volatile_range_shrink() should really be called > volatile_range_resize(), since having two _shrink calls is terrible. My > apologies.
And sure enough in the shrinker we're not holding the vlist_mutex. Thanks for pointing that out. -john
| |