]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ceph: remove the incorrect Fw reference check when dirtying pages
authorXiubo Li <xiubli@redhat.com>
Wed, 4 Sep 2024 22:22:18 +0000 (06:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:08:06 +0000 (15:08 +0200)
[ Upstream commit c08dfb1b49492c09cf13838c71897493ea3b424e ]

When doing the direct-io reads it will also try to mark pages dirty,
but for the read path it won't hold the Fw caps and there is case
will it get the Fw reference.

Fixes: 5dda377cf0a6 ("ceph: set i_head_snapc when getting CEPH_CAP_FILE_WR reference")
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ceph/addr.c

index 3465ff95cb89f22da8f9ea63b7ddc37da3ef737d..2362f2591f4ad620808af16610b941fd2a82994d 100644 (file)
@@ -91,7 +91,6 @@ static int ceph_set_page_dirty(struct page *page)
 
        /* dirty the head */
        spin_lock(&ci->i_ceph_lock);
-       BUG_ON(ci->i_wr_ref == 0); // caller should hold Fw reference
        if (__ceph_have_pending_cap_snap(ci)) {
                struct ceph_cap_snap *capsnap =
                                list_last_entry(&ci->i_cap_snaps,