Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 04242ff3 authored by Yan, Zheng's avatar Yan, Zheng Committed by Ilya Dryomov
Browse files

ceph: avoid repeatedly adding inode to mdsc->snap_flush_list



Otherwise, mdsc->snap_flush_list may get corrupted.

Cc: stable@vger.kernel.org
Signed-off-by: default avatar"Yan, Zheng" <zyan@redhat.com>
Reviewed-by: default avatarIlya Dryomov <idryomov@gmail.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 0fd3fd0a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -616,6 +616,7 @@ int __ceph_finish_cap_snap(struct ceph_inode_info *ci,
	     capsnap->size);

	spin_lock(&mdsc->snap_flush_lock);
	if (list_empty(&ci->i_snap_flush_item))
		list_add_tail(&ci->i_snap_flush_item, &mdsc->snap_flush_list);
	spin_unlock(&mdsc->snap_flush_lock);
	return 1;  /* caller may want to ceph_flush_snaps */