quota: Push dqio_sem down to ->read_file_info()
[sfrench/cifs-2.6.git] / fs / quota / quota_v1.c
index fe68bf544b29881530dc1f953c242a50487f5b28..b2d8e04e567a416869587f2bbbb36cfa0909d8aa 100644 (file)
@@ -161,6 +161,7 @@ static int v1_read_file_info(struct super_block *sb, int type)
        struct v1_disk_dqblk dqblk;
        int ret;
 
+       down_read(&dqopt->dqio_sem);
        ret = sb->s_op->quota_read(sb, type, (char *)&dqblk,
                                sizeof(struct v1_disk_dqblk), v1_dqoff(0));
        if (ret != sizeof(struct v1_disk_dqblk)) {
@@ -177,6 +178,7 @@ static int v1_read_file_info(struct super_block *sb, int type)
        dqopt->info[type].dqi_bgrace =
                        dqblk.dqb_btime ? dqblk.dqb_btime : MAX_DQ_TIME;
 out:
+       up_read(&dqopt->dqio_sem);
        return ret;
 }