Commit fce17cb0 authored by Bob Peterson's avatar Bob Peterson Committed by Andreas Gruenbacher

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: default avatarBob Peterson <rpeterso@redhat.com>
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
parent dec64ae3
...@@ -991,6 +991,10 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda) ...@@ -991,6 +991,10 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda)
GFS2_LOG_HEAD_FLUSH_NORMAL | GFS2_LFC_DO_SYNC); GFS2_LOG_HEAD_FLUSH_NORMAL | GFS2_LFC_DO_SYNC);
out: out:
gfs2_qa_put(ip); gfs2_qa_put(ip);
if (!error) {
for (x = 0; x < num_qd; x++)
qda[x]->qd_sync_gen = sdp->sd_quota_sync_gen;
}
return error; return error;
} }
...@@ -1334,10 +1338,6 @@ int gfs2_quota_sync(struct super_block *sb, int type) ...@@ -1334,10 +1338,6 @@ int gfs2_quota_sync(struct super_block *sb, int type)
if (num_qd) { if (num_qd) {
if (!error) if (!error)
error = do_sync(num_qd, qda); error = do_sync(num_qd, qda);
if (!error)
for (x = 0; x < num_qd; x++)
qda[x]->qd_sync_gen =
sdp->sd_quota_sync_gen;
for (x = 0; x < num_qd; x++) for (x = 0; x < num_qd; x++)
qd_unlock(qda[x]); qd_unlock(qda[x]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment