gfs2: The freeze glock should never be frozen
Before this patch, some gfs2 code locked the freeze glock with LM_FLAG_NOEXP (Do not freeze) flag, and some did not. We never want to freeze the freeze glock, so this patch makes it consistently use LM_FLAG_NOEXP always. Signed-off-by: Bob Peterson <rpeterso@redhat.com>
This commit is contained in:
parent
623ba664b7
commit
c860f8ffbe
@ -1140,7 +1140,8 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc)
|
|||||||
struct gfs2_holder freeze_gh;
|
struct gfs2_holder freeze_gh;
|
||||||
|
|
||||||
error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED,
|
error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED,
|
||||||
GL_EXACT, &freeze_gh);
|
LM_FLAG_NOEXP | GL_EXACT,
|
||||||
|
&freeze_gh);
|
||||||
if (error) {
|
if (error) {
|
||||||
fs_err(sdp, "can't make FS RO: %d\n", error);
|
fs_err(sdp, "can't make FS RO: %d\n", error);
|
||||||
goto fail_per_node;
|
goto fail_per_node;
|
||||||
|
@ -167,7 +167,8 @@ int gfs2_make_fs_rw(struct gfs2_sbd *sdp)
|
|||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED, GL_EXACT,
|
error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED,
|
||||||
|
LM_FLAG_NOEXP | GL_EXACT,
|
||||||
&freeze_gh);
|
&freeze_gh);
|
||||||
if (error)
|
if (error)
|
||||||
goto fail_threads;
|
goto fail_threads;
|
||||||
@ -429,7 +430,7 @@ static int gfs2_lock_fs_check_clean(struct gfs2_sbd *sdp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_EXCLUSIVE,
|
error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_EXCLUSIVE,
|
||||||
0, &sdp->sd_freeze_gh);
|
LM_FLAG_NOEXP, &sdp->sd_freeze_gh);
|
||||||
if (error)
|
if (error)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
@ -612,14 +613,15 @@ int gfs2_make_fs_ro(struct gfs2_sbd *sdp)
|
|||||||
!gfs2_glock_is_locked_by_me(sdp->sd_freeze_gl)) {
|
!gfs2_glock_is_locked_by_me(sdp->sd_freeze_gl)) {
|
||||||
if (!log_write_allowed) {
|
if (!log_write_allowed) {
|
||||||
error = gfs2_glock_nq_init(sdp->sd_freeze_gl,
|
error = gfs2_glock_nq_init(sdp->sd_freeze_gl,
|
||||||
LM_ST_SHARED,
|
LM_ST_SHARED, LM_FLAG_TRY |
|
||||||
LM_FLAG_TRY | GL_EXACT,
|
LM_FLAG_NOEXP | GL_EXACT,
|
||||||
&freeze_gh);
|
&freeze_gh);
|
||||||
if (error == GLR_TRYFAILED)
|
if (error == GLR_TRYFAILED)
|
||||||
error = 0;
|
error = 0;
|
||||||
} else {
|
} else {
|
||||||
error = gfs2_glock_nq_init(sdp->sd_freeze_gl,
|
error = gfs2_glock_nq_init(sdp->sd_freeze_gl,
|
||||||
LM_ST_SHARED, GL_EXACT,
|
LM_ST_SHARED,
|
||||||
|
LM_FLAG_NOEXP | GL_EXACT,
|
||||||
&freeze_gh);
|
&freeze_gh);
|
||||||
if (error && !gfs2_withdrawn(sdp))
|
if (error && !gfs2_withdrawn(sdp))
|
||||||
return error;
|
return error;
|
||||||
@ -761,8 +763,8 @@ void gfs2_freeze_func(struct work_struct *work)
|
|||||||
struct super_block *sb = sdp->sd_vfs;
|
struct super_block *sb = sdp->sd_vfs;
|
||||||
|
|
||||||
atomic_inc(&sb->s_active);
|
atomic_inc(&sb->s_active);
|
||||||
error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED, GL_EXACT,
|
error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED,
|
||||||
&freeze_gh);
|
LM_FLAG_NOEXP | GL_EXACT, &freeze_gh);
|
||||||
if (error) {
|
if (error) {
|
||||||
fs_info(sdp, "GFS2: couldn't get freeze lock : %d\n", error);
|
fs_info(sdp, "GFS2: couldn't get freeze lock : %d\n", error);
|
||||||
gfs2_assert_withdraw(sdp, 0);
|
gfs2_assert_withdraw(sdp, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user