diff options
author | Jan Kara <jack@suse.cz> | 2010-03-31 14:25:37 (GMT) |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2010-05-21 17:30:47 (GMT) |
commit | fb8dd8d780140a3f0e9074831a59054fec6cc451 (patch) | |
tree | 09e9f7bf157784fc6b0a7df71c1fbfe711349055 /fs/nfs | |
parent | ae4f6ef13417deaa49471c0e903914a3ef3be258 (diff) | |
download | linux-fsl-qoriq-fb8dd8d780140a3f0e9074831a59054fec6cc451.tar.xz |
ocfs2: Fix quota locking
OCFS2 had three issues with quota locking:
a) When reading dquot from global quota file, we started a transaction while
holding dqio_mutex which is prone to deadlocks because other paths do it
the other way around
b) During ocfs2_sync_dquot we were not protected against concurrent writers
on the same node. Because we first copy data to local buffer, a race
could happen resulting in old data being written to global quota file and
thus causing quota inconsistency after a crash.
c) ip_alloc_sem of quota files was acquired while a transaction is started
in ocfs2_quota_write which can deadlock because we first get ip_alloc_sem
and then start a transaction when extending quota files.
We fix the problem a) by pulling all necessary code to ocfs2_acquire_dquot
and ocfs2_release_dquot. Thus we no longer depend on generic dquot_acquire
to do the locking and can force proper lock ordering.
Problems b) and c) are fixed by locking i_mutex and ip_alloc_sem of
global quota file in ocfs2_lock_global_qf and removing ip_alloc_sem from
ocfs2_quota_read and ocfs2_quota_write.
Acked-by: Joel Becker <Joel.Becker@oracle.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/nfs')
0 files changed, 0 insertions, 0 deletions