File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ struct lm_lockops {
136136 void (* lm_first_done ) (struct gfs2_sbd * sdp );
137137 void (* lm_recovery_result ) (struct gfs2_sbd * sdp , unsigned int jid ,
138138 unsigned int result );
139- void (* lm_unmount ) (struct gfs2_sbd * sdp );
139+ void (* lm_unmount ) (struct gfs2_sbd * sdp , bool clean );
140140 void (* lm_withdraw ) (struct gfs2_sbd * sdp );
141141 void (* lm_put_lock ) (struct gfs2_glock * gl );
142142 int (* lm_lock ) (struct gfs2_glock * gl , unsigned int req_state ,
Original file line number Diff line number Diff line change @@ -1438,7 +1438,15 @@ static void gdlm_first_done(struct gfs2_sbd *sdp)
14381438 fs_err (sdp , "mount first_done error %d\n" , error );
14391439}
14401440
1441- static void gdlm_unmount (struct gfs2_sbd * sdp )
1441+ /*
1442+ * gdlm_unmount - release our lockspace
1443+ * @sdp: the superblock
1444+ * @clean: Indicates whether or not the remaining nodes in the cluster should
1445+ * perform recovery. Recovery is necessary when a node withdraws and
1446+ * its journal remains dirty. Recovery isn't necessary when a node
1447+ * cleanly unmounts a filesystem.
1448+ */
1449+ static void gdlm_unmount (struct gfs2_sbd * sdp , bool clean )
14421450{
14431451 struct lm_lockstruct * ls = & sdp -> sd_lockstruct ;
14441452
@@ -1456,7 +1464,9 @@ static void gdlm_unmount(struct gfs2_sbd *sdp)
14561464release :
14571465 down_write (& ls -> ls_sem );
14581466 if (ls -> ls_dlm ) {
1459- dlm_release_lockspace (ls -> ls_dlm , DLM_RELEASE_NORMAL );
1467+ dlm_release_lockspace (ls -> ls_dlm ,
1468+ clean ? DLM_RELEASE_NORMAL :
1469+ DLM_RELEASE_RECOVER );
14601470 ls -> ls_dlm = NULL ;
14611471 }
14621472 up_write (& ls -> ls_sem );
Original file line number Diff line number Diff line change @@ -1041,7 +1041,7 @@ void gfs2_lm_unmount(struct gfs2_sbd *sdp)
10411041{
10421042 const struct lm_lockops * lm = sdp -> sd_lockstruct .ls_ops ;
10431043 if (!gfs2_withdrawing_or_withdrawn (sdp ) && lm -> lm_unmount )
1044- lm -> lm_unmount (sdp );
1044+ lm -> lm_unmount (sdp , true );
10451045}
10461046
10471047static int wait_on_journal (struct gfs2_sbd * sdp )
Original file line number Diff line number Diff line change @@ -339,7 +339,7 @@ void gfs2_withdraw(struct gfs2_sbd *sdp)
339339
340340 if (lm -> lm_unmount ) {
341341 fs_err (sdp , "telling LM to unmount\n" );
342- lm -> lm_unmount (sdp );
342+ lm -> lm_unmount (sdp , false );
343343 }
344344 fs_err (sdp , "File system withdrawn\n" );
345345 dump_stack ();
You can’t perform that action at this time.
0 commit comments