diff options
author | Bob Peterson <rpeterso@redhat.com> | 2023-06-22 19:04:45 +0300 |
---|---|---|
committer | Andreas Gruenbacher <agruenba@redhat.com> | 2023-09-05 16:58:18 +0300 |
commit | fce17cb0eebfb90618f0fcfbdc7f8e0aa207c81a (patch) | |
tree | 25d39dbdd428b88b1dd5b544b1f567d5ef7033ee /fs/gfs2/quota.c | |
parent | dec64ae37bf90c2ae3fba2089f5bd1d025c57995 (diff) | |
download | linux-fce17cb0eebfb90618f0fcfbdc7f8e0aa207c81a.tar.xz |
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 <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2/quota.c')
-rw-r--r-- | fs/gfs2/quota.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 6824c7497d99..e12d54104485 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -991,6 +991,10 @@ out_dq: GFS2_LOG_HEAD_FLUSH_NORMAL | GFS2_LFC_DO_SYNC); out: 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; } @@ -1334,10 +1338,6 @@ int gfs2_quota_sync(struct super_block *sb, int type) if (num_qd) { if (!error) 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++) qd_unlock(qda[x]); |