quota: Fix possible races during quota loading
authorJan Kara <jack@suse.cz>
Thu, 18 Feb 2016 12:20:20 +0000 (13:20 +0100)
committerJan Kara <jack@suse.cz>
Thu, 18 Feb 2016 12:34:41 +0000 (13:34 +0100)
commit044c9b6753a6b6cf486e16b53296b4707b35dbe3
tree4854ad052572bab2d07d6d74b247d0017b177452
parent5a9530e498ed25173d426cd93e31a04468d0dc24
quota: Fix possible races during quota loading

When loading new quota structure from disk, there is a possibility caller
of dqget() will see uninitialized data due to CPU reordering loads or
stores - loads from dquot can be reordered before test of DQ_ACTIVE_B
bit or setting of this bit could be reordered before filling of the
structure. Fix the issue by adding proper memory barriers.

Signed-off-by: Jan Kara <jack@suse.cz>
fs/quota/dquot.c