Skip to content

Commit

Permalink
GFS2: fail mount if journal recovery fails
Browse files Browse the repository at this point in the history
If the first mounter fails to recover one of the journals
during mount, the mount should fail.

Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
David Teigland authored and Steven Whitehouse committed Jan 11, 2012
1 parent e8ca5cc commit 376d377
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions fs/gfs2/incore.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ struct gfs2_jdesc {
#define JDF_RECOVERY 1
unsigned int jd_jid;
unsigned int jd_blocks;
int jd_recover_error;
};

struct gfs2_statfs_change_host {
Expand Down
3 changes: 2 additions & 1 deletion fs/gfs2/recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ void gfs2_recover_func(struct work_struct *work)

fs_info(sdp, "jid=%u: %s\n", jd->jd_jid, (error) ? "Failed" : "Done");
fail:
jd->jd_recover_error = error;
gfs2_recovery_done(sdp, jd->jd_jid, LM_RD_GAVEUP);
done:
clear_bit(JDF_RECOVERY, &jd->jd_flags);
Expand Down Expand Up @@ -611,6 +612,6 @@ int gfs2_recover_journal(struct gfs2_jdesc *jd, bool wait)
wait_on_bit(&jd->jd_flags, JDF_RECOVERY, gfs2_recovery_wait,
TASK_UNINTERRUPTIBLE);

return 0;
return wait ? jd->jd_recover_error : 0;
}

0 comments on commit 376d377

Please sign in to comment.