[PATCH] quota: workaround IO errors on dquot_initialize

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

 



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


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux