Skip to content

Commit fce17cb

Browse files
AstralBobAndreas Gruenbacher
authored andcommitted
gfs2: Set qd_sync_gen in do_sync
Func do_sync was called in two places: gfs2_quota_unlock and gfs2_quota_sync. In gfs2_quota_sync it updated qd_sync_gen to the latest superblock sync gen, if do_sync was successful. In gfs2_quota_unlock it didn't update the value. That can only lead to extra work, for example, if the value is synced by gfs2_quota_unlock but still has the old value. This patch moves the setting of qd_sync_gen inside do_sync so we are guaranteed consistency. Signed-off-by: Bob Peterson <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent dec64ae commit fce17cb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fs/gfs2/quota.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,10 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda)
991991
GFS2_LOG_HEAD_FLUSH_NORMAL | GFS2_LFC_DO_SYNC);
992992
out:
993993
gfs2_qa_put(ip);
994+
if (!error) {
995+
for (x = 0; x < num_qd; x++)
996+
qda[x]->qd_sync_gen = sdp->sd_quota_sync_gen;
997+
}
994998
return error;
995999
}
9961000

@@ -1334,10 +1338,6 @@ int gfs2_quota_sync(struct super_block *sb, int type)
13341338
if (num_qd) {
13351339
if (!error)
13361340
error = do_sync(num_qd, qda);
1337-
if (!error)
1338-
for (x = 0; x < num_qd; x++)
1339-
qda[x]->qd_sync_gen =
1340-
sdp->sd_quota_sync_gen;
13411341

13421342
for (x = 0; x < num_qd; x++)
13431343
qd_unlock(qda[x]);

0 commit comments

Comments
 (0)