On Mon, Oct 11, 2010 at 5:33 PM, Jan Kara <jack@xxxxxxx> wrote: > On Sat 09-10-10 23:15:30, Dmitry wrote: >> >> I've got following lockup: >> dquot_disable               Âdquot_transfer >>                       ->dqget() >>                       Âsb_has_quota_active >> dqopt->flags &= ~dquot_state_flag(f, cnt)   Âatomic_inc(dq->dq_count) >> Â->drop_dquot_ref(sb, cnt); >>   down_write(dqptr_sem) >>   inode->i_dquot[cnt] = NULL       Â->__dquot_transfer >> invalidate_dquots(sb, cnt);         Âdown_write(&dqptr_sem) >>  ->wait for dq_wait_unused         Âinode->i_dquot = new_dquot >>  /* wait forever */              Â^^^^New quota user^^^^^^ >> >> Inodes was already cleaned from quotas, and we can not allow new ones. >> We have to recheck quota state under dqptr_sem and before assignment, >> as we do it in dquot_initialize() > ÂThanks. Merged into my tree. BTW, after two days of stress-testing i've got another bug. Disk space was elapsed, and dqget failed. Fix attached. > >                                ÂHonza > -- > Jan Kara <jack@xxxxxxx> > SUSE Labs, CR >
From 79d9128c551b3d452cbc788553b70dbf200f2a04 Mon Sep 17 00:00:00 2001 From: Dmitry Monakhov <dmonakhov@xxxxxxxxx> Date: Sun, 10 Oct 2010 00:48:28 +0400 Subject: [PATCH] quota: workaround IO errors on dquot_initialize Due to IO errors we may not have dquot object. --- fs/quota/dquot.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 5b262d3..e0f2924 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -1394,7 +1394,7 @@ static void __dquot_initialize(struct inode *inode, int type) * did a write before quota was turned on */ rsv = inode_get_rsv_space(inode); - if (unlikely(rsv)) + if (unlikely(rsv && got[cnt])) dquot_resv_space(inode->i_dquot[cnt], rsv); } } -- 1.7.0.4