gfs2: Clean up revokes on normal withdraws
Before this patch, the system ail lists were cleaned up if the logd process withdrew, but on other withdraws, they were not cleaned up. This included the cleaning up of the revokes as well. This patch reorganizes things a bit so that all withdraws (not just logd) clean up the ail lists, including any pending revokes. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
This commit is contained in:
parent
865cc3e9cc
commit
f5456b5d67
@ -926,10 +926,10 @@ static void log_write_header(struct gfs2_sbd *sdp, u32 flags)
|
||||
}
|
||||
|
||||
/**
|
||||
* ail_drain - drain the ail lists after a withdraw
|
||||
* gfs2_ail_drain - drain the ail lists after a withdraw
|
||||
* @sdp: Pointer to GFS2 superblock
|
||||
*/
|
||||
static void ail_drain(struct gfs2_sbd *sdp)
|
||||
void gfs2_ail_drain(struct gfs2_sbd *sdp)
|
||||
{
|
||||
struct gfs2_trans *tr;
|
||||
|
||||
@ -956,6 +956,7 @@ static void ail_drain(struct gfs2_sbd *sdp)
|
||||
list_del(&tr->tr_list);
|
||||
gfs2_trans_free(sdp, tr);
|
||||
}
|
||||
gfs2_drain_revokes(sdp);
|
||||
spin_unlock(&sdp->sd_ail_lock);
|
||||
}
|
||||
|
||||
@ -1162,7 +1163,6 @@ out_withdraw:
|
||||
if (tr && list_empty(&tr->tr_list))
|
||||
list_add(&tr->tr_list, &sdp->sd_ail1_list);
|
||||
spin_unlock(&sdp->sd_ail_lock);
|
||||
ail_drain(sdp); /* frees all transactions */
|
||||
tr = NULL;
|
||||
goto out_end;
|
||||
}
|
||||
|
@ -93,5 +93,6 @@ extern int gfs2_logd(void *data);
|
||||
extern void gfs2_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd);
|
||||
extern void gfs2_glock_remove_revoke(struct gfs2_glock *gl);
|
||||
extern void gfs2_flush_revokes(struct gfs2_sbd *sdp);
|
||||
extern void gfs2_ail_drain(struct gfs2_sbd *sdp);
|
||||
|
||||
#endif /* __LOG_DOT_H__ */
|
||||
|
@ -885,7 +885,7 @@ static void revoke_lo_before_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr)
|
||||
gfs2_log_write_page(sdp, page);
|
||||
}
|
||||
|
||||
static void revoke_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr)
|
||||
void gfs2_drain_revokes(struct gfs2_sbd *sdp)
|
||||
{
|
||||
struct list_head *head = &sdp->sd_log_revokes;
|
||||
struct gfs2_bufdata *bd;
|
||||
@ -900,6 +900,11 @@ static void revoke_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr)
|
||||
}
|
||||
}
|
||||
|
||||
static void revoke_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr)
|
||||
{
|
||||
gfs2_drain_revokes(sdp);
|
||||
}
|
||||
|
||||
static void revoke_lo_before_scan(struct gfs2_jdesc *jd,
|
||||
struct gfs2_log_header_host *head, int pass)
|
||||
{
|
||||
|
@ -20,6 +20,7 @@ extern void gfs2_log_submit_bio(struct bio **biop, int opf);
|
||||
extern void gfs2_pin(struct gfs2_sbd *sdp, struct buffer_head *bh);
|
||||
extern int gfs2_find_jhead(struct gfs2_jdesc *jd,
|
||||
struct gfs2_log_header_host *head, bool keep_cache);
|
||||
extern void gfs2_drain_revokes(struct gfs2_sbd *sdp);
|
||||
static inline unsigned int buf_limit(struct gfs2_sbd *sdp)
|
||||
{
|
||||
return sdp->sd_ldptrs;
|
||||
|
@ -131,6 +131,7 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp)
|
||||
if (test_bit(SDF_NORECOVERY, &sdp->sd_flags) || !sdp->sd_jdesc)
|
||||
return;
|
||||
|
||||
gfs2_ail_drain(sdp); /* frees all transactions */
|
||||
inode = sdp->sd_jdesc->jd_inode;
|
||||
ip = GFS2_I(inode);
|
||||
i_gl = ip->i_gl;
|
||||
|
Loading…
Reference in New Issue
Block a user