--- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -462,6 +462,8 @@ static int qd_fish(struct gfs2_sbd *sdp, struct gfs2_quota_data **qdp) list_for_each_entry(iter, &sdp->sd_quota_list, qd_list) { if (qd_check_sync(sdp, iter, &sdp->sd_quota_sync_gen)) { + if (!need_sync(iter)) + continue; qd = iter; break; } @@ -1321,6 +1323,9 @@ int gfs2_quota_sync(struct super_block *sb, int type) qda[x]->qd_sync_gen = sdp->sd_quota_sync_gen; + if (error == -EIO) + break; + for (x = 0; x < num_qd; x++) qd_unlock(qda[x]); }