From 3bdde33b909a513150384769e8425e6b0fc94ec7 Mon Sep 17 00:00:00 2001 From: tianzy Date: Wed, 18 Feb 2009 07:52:32 +0000 Subject: [PATCH] Branch b1_8 Releasing quota between lquota_chkquota() and filter_direct_io() could make false -EDQUOT b=18491 i=johann i=andrew.perepechko --- lustre/quota/quota_interface.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lustre/quota/quota_interface.c b/lustre/quota/quota_interface.c index c2f1a79..5e8ac6e 100644 --- a/lustre/quota/quota_interface.c +++ b/lustre/quota/quota_interface.c @@ -309,6 +309,23 @@ static int quota_check_common(struct obd_device *obd, unsigned int uid, } } + /* if xx_rec < 0, that means quota are releasing, + * and it may return before we use quota. So if + * we find this situation, we assuming it has + * returned b=18491 */ + if (isblk && lqs->lqs_blk_rec < 0) { + if (qdata[i].qd_count < -lqs->lqs_blk_rec) + qdata[i].qd_count = 0; + else + qdata[i].qd_count += lqs->lqs_blk_rec; + } + if (!isblk && lqs->lqs_ino_rec < 0) { + if (qdata[i].qd_count < -lqs->lqs_ino_rec) + qdata[i].qd_count = 0; + else + qdata[i].qd_count += lqs->lqs_ino_rec; + } + CDEBUG(D_QUOTA, "count: %d, lqs pending: %lu, qd_count: "LPU64 ", metablocks: %d, isblk: %d, pending: %d.\n", count, isblk ? lqs->lqs_bwrite_pending : lqs->lqs_iwrite_pending, -- 1.8.3.1