Commit 8e29be34 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'gfs2-v5.12-rc2-fixes2' of git://git.kernel.org/pub/scm/linux/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
parents 7fd7d5c2 ff132c5f
...@@ -162,8 +162,10 @@ int gfs2_make_fs_rw(struct gfs2_sbd *sdp) ...@@ -162,8 +162,10 @@ int gfs2_make_fs_rw(struct gfs2_sbd *sdp)
int error; int error;
error = init_threads(sdp); error = init_threads(sdp);
if (error) if (error) {
gfs2_withdraw_delayed(sdp);
return error; return error;
}
j_gl->gl_ops->go_inval(j_gl, DIO_METADATA); j_gl->gl_ops->go_inval(j_gl, DIO_METADATA);
if (gfs2_withdrawn(sdp)) { if (gfs2_withdrawn(sdp)) {
...@@ -750,11 +752,13 @@ void gfs2_freeze_func(struct work_struct *work) ...@@ -750,11 +752,13 @@ void gfs2_freeze_func(struct work_struct *work)
static int gfs2_freeze(struct super_block *sb) static int gfs2_freeze(struct super_block *sb)
{ {
struct gfs2_sbd *sdp = sb->s_fs_info; struct gfs2_sbd *sdp = sb->s_fs_info;
int error = 0; int error;
mutex_lock(&sdp->sd_freeze_mutex); 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; goto out;
}
for (;;) { for (;;) {
if (gfs2_withdrawn(sdp)) { if (gfs2_withdrawn(sdp)) {
...@@ -798,7 +802,7 @@ static int gfs2_unfreeze(struct super_block *sb) ...@@ -798,7 +802,7 @@ static int gfs2_unfreeze(struct super_block *sb)
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)) { !gfs2_holder_initialized(&sdp->sd_freeze_gh)) {
mutex_unlock(&sdp->sd_freeze_mutex); mutex_unlock(&sdp->sd_freeze_mutex);
return 0; return -EINVAL;
} }
gfs2_freeze_unlock(&sdp->sd_freeze_gh); gfs2_freeze_unlock(&sdp->sd_freeze_gh);
......
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