Skip to content

Commit

Permalink
Merge tag 'gfs2-v5.12-rc2-fixes2' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/gfs2/linux-gfs2

Pull gfs2 fixes from Andreas Gruenbacher:
 "Two more gfs2 fixes"

* tag 'gfs2-v5.12-rc2-fixes2' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
  gfs2: report "already frozen/thawed" errors
  gfs2: Flag a withdraw if init_threads() fails
  • Loading branch information
torvalds committed Apr 3, 2021
2 parents 7fd7d5c + ff132c5 commit 8e29be3
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions fs/gfs2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,10 @@ int gfs2_make_fs_rw(struct gfs2_sbd *sdp)
int error;

error = init_threads(sdp);
if (error)
if (error) {
gfs2_withdraw_delayed(sdp);
return error;
}

j_gl->gl_ops->go_inval(j_gl, DIO_METADATA);
if (gfs2_withdrawn(sdp)) {
Expand Down Expand Up @@ -750,11 +752,13 @@ void gfs2_freeze_func(struct work_struct *work)
static int gfs2_freeze(struct super_block *sb)
{
struct gfs2_sbd *sdp = sb->s_fs_info;
int error = 0;
int error;

mutex_lock(&sdp->sd_freeze_mutex);
if (atomic_read(&sdp->sd_freeze_state) != SFS_UNFROZEN)
if (atomic_read(&sdp->sd_freeze_state) != SFS_UNFROZEN) {
error = -EBUSY;
goto out;
}

for (;;) {
if (gfs2_withdrawn(sdp)) {
Expand Down Expand Up @@ -795,10 +799,10 @@ static int gfs2_unfreeze(struct super_block *sb)
struct gfs2_sbd *sdp = sb->s_fs_info;

mutex_lock(&sdp->sd_freeze_mutex);
if (atomic_read(&sdp->sd_freeze_state) != SFS_FROZEN ||
if (atomic_read(&sdp->sd_freeze_state) != SFS_FROZEN ||
!gfs2_holder_initialized(&sdp->sd_freeze_gh)) {
mutex_unlock(&sdp->sd_freeze_mutex);
return 0;
return -EINVAL;
}

gfs2_freeze_unlock(&sdp->sd_freeze_gh);
Expand Down

0 comments on commit 8e29be3

Please sign in to comment.