mirror of https://gitee.com/openkylin/linux.git
quota: Acquire dqio_sem for reading in dquot_get_next_id()
dquot_get_next_id() needs dqio_sem only for reading to protect against racing with modification of quota file structure. Reviewed-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
parent
62676838cb
commit
0cff9151d3
|
@ -2079,9 +2079,9 @@ int dquot_get_next_id(struct super_block *sb, struct kqid *qid)
|
||||||
return -ESRCH;
|
return -ESRCH;
|
||||||
if (!dqopt->ops[qid->type]->get_next_id)
|
if (!dqopt->ops[qid->type]->get_next_id)
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
down_write(&dqopt->dqio_sem);
|
down_read(&dqopt->dqio_sem);
|
||||||
err = dqopt->ops[qid->type]->get_next_id(sb, qid);
|
err = dqopt->ops[qid->type]->get_next_id(sb, qid);
|
||||||
up_write(&dqopt->dqio_sem);
|
up_read(&dqopt->dqio_sem);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(dquot_get_next_id);
|
EXPORT_SYMBOL(dquot_get_next_id);
|
||||||
|
|
Loading…
Reference in New Issue