File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -4764,7 +4764,7 @@ static void delayed_work(struct work_struct *work)
4764
4764
4765
4765
dout ("mdsc delayed_work\n" );
4766
4766
4767
- if (mdsc -> stopping )
4767
+ if (mdsc -> stopping >= CEPH_MDSC_STOPPING_FLUSHED )
4768
4768
return ;
4769
4769
4770
4770
mutex_lock (& mdsc -> mutex );
@@ -4943,7 +4943,7 @@ void send_flush_mdlog(struct ceph_mds_session *s)
4943
4943
void ceph_mdsc_pre_umount (struct ceph_mds_client * mdsc )
4944
4944
{
4945
4945
dout ("pre_umount\n" );
4946
- mdsc -> stopping = 1 ;
4946
+ mdsc -> stopping = CEPH_MDSC_STOPPING_BEGIN ;
4947
4947
4948
4948
ceph_mdsc_iterate_sessions (mdsc , send_flush_mdlog , true);
4949
4949
ceph_mdsc_iterate_sessions (mdsc , lock_unlock_session , false);
Original file line number Diff line number Diff line change @@ -380,6 +380,11 @@ struct cap_wait {
380
380
int want ;
381
381
};
382
382
383
+ enum {
384
+ CEPH_MDSC_STOPPING_BEGIN = 1 ,
385
+ CEPH_MDSC_STOPPING_FLUSHED = 2 ,
386
+ };
387
+
383
388
/*
384
389
* mds client state
385
390
*/
Original file line number Diff line number Diff line change @@ -1374,6 +1374,16 @@ static void ceph_kill_sb(struct super_block *s)
1374
1374
ceph_mdsc_pre_umount (fsc -> mdsc );
1375
1375
flush_fs_workqueues (fsc );
1376
1376
1377
+ /*
1378
+ * Though the kill_anon_super() will finally trigger the
1379
+ * sync_filesystem() anyway, we still need to do it here
1380
+ * and then bump the stage of shutdown to stop the work
1381
+ * queue as earlier as possible.
1382
+ */
1383
+ sync_filesystem (s );
1384
+
1385
+ fsc -> mdsc -> stopping = CEPH_MDSC_STOPPING_FLUSHED ;
1386
+
1377
1387
kill_anon_super (s );
1378
1388
1379
1389
fsc -> client -> extra_mon_dispatch = NULL ;
You can’t perform that action at this time.
0 commit comments