FAILED: patch "[PATCH] ceph: defer stopping mdsc delayed_work" failed to apply to 5.4-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.4.y
git checkout FETCH_HEAD
git cherry-pick -x e7e607bd00481745550389a29ecabe33e13d67cf
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2023080733-snowbound-wagon-56bb@gregkh' --subject-prefix 'PATCH 5.4.y' HEAD^..
Possible dependencies:
e7e607bd0048 ("ceph: defer stopping mdsc delayed_work") 470a5c77eac0 ("ceph: use kill_anon_super helper") fa9967734227 ("ceph: fix potential mdsc use-after-free crash") 3a3430affce5 ("ceph: show tasks waiting on caps in debugfs caps file")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From e7e607bd00481745550389a29ecabe33e13d67cf Mon Sep 17 00:00:00 2001
From: Xiubo Li <[email protected]>
Date: Tue, 25 Jul 2023 12:03:59 +0800
Subject: [PATCH] ceph: defer stopping mdsc delayed_work
Flushing the dirty buffer may take a long time if the cluster is overloaded or if there is network issue. So we should ping the MDSs periodically to keep alive, else the MDS will blocklist the kclient.
fs/ceph/mds_client.c +2 -2
@@ -4764,7 +4764,7 @@ static void delayed_work(struct work_struct *work)dout ("mdsc delayed_work\n" ); -if (mdsc->stopping) +if (mdsc->stopping >=CEPH_MDSC_STOPPING_FLUSHED )return ;mutex_lock (&mdsc->mutex);
@@ -4943,7 +4943,7 @@ void send_flush_mdlog(struct ceph_mds_session *s)void ceph_mdsc_pre_umount (struct ceph_mds_client *mdsc) {dout ("pre_umount\n" ); - mdsc->stopping =1 ; + mdsc->stopping =CEPH_MDSC_STOPPING_BEGIN ;ceph_mdsc_iterate_sessions (mdsc, send_flush_mdlog, true);ceph_mdsc_iterate_sessions (mdsc, lock_unlock_session, false);
fs/ceph/mds_client.h +5 -0
@@ -380,6 +380,11 @@ struct cap_wait {int want; }; +enum { +CEPH_MDSC_STOPPING_BEGIN =1 , +CEPH_MDSC_STOPPING_FLUSHED =2 , +}; +/* * mds client state */
fs/ceph/super.c +10 -0
@@ -1374,6 +1374,16 @@ static void ceph_kill_sb(struct super_block *s)ceph_mdsc_pre_umount (fsc->mdsc);flush_fs_workqueues (fsc); +/* +* Though the kill_anon_super() will finally trigger the +* sync_filesystem() anyway, we still need to do it here +* and then bump the stage of shutdown to stop the work +* queue as earlier as possible. +*/ +sync_filesystem (s); + + fsc->mdsc->stopping =CEPH_MDSC_STOPPING_FLUSHED ; +kill_anon_super (s); fsc->client->extra_mon_dispatch =NULL ;