Skip to content

Commit

Permalink
quota: Remove locking for writing to the old quota format
Browse files Browse the repository at this point in the history
The old quota quota format has fixed offset in quota file based on ID so
there's no locking needed against concurrent modifications of the file
(locking against concurrent IO on the same dquot is still provided by
dq_lock).

Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Jan Kara <jack@suse.cz>
  • Loading branch information
Jan Kara committed Aug 17, 2017
1 parent d2faa41 commit f0c5bae
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions fs/quota/quota_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ static int v1_commit_dqblk(struct dquot *dquot)
short type = dquot->dq_id.type;
ssize_t ret;
struct v1_disk_dqblk dqblk;
struct quota_info *dqopt = sb_dqopt(dquot->dq_sb);

down_write(&dqopt->dqio_sem);
v1_mem2disk_dqblk(&dqblk, &dquot->dq_dqb);
if (((type == USRQUOTA) && uid_eq(dquot->dq_id.uid, GLOBAL_ROOT_UID)) ||
((type == GRPQUOTA) && gid_eq(dquot->dq_id.gid, GLOBAL_ROOT_GID))) {
Expand All @@ -99,7 +97,6 @@ static int v1_commit_dqblk(struct dquot *dquot)
ret = dquot->dq_sb->s_op->quota_write(dquot->dq_sb, type,
(char *)&dqblk, sizeof(struct v1_disk_dqblk),
v1_dqoff(from_kqid(&init_user_ns, dquot->dq_id)));
up_write(&dqopt->dqio_sem);
if (ret != sizeof(struct v1_disk_dqblk)) {
quota_error(dquot->dq_sb, "dquota write failed");
if (ret >= 0)
Expand Down

0 comments on commit f0c5bae

Please sign in to comment.