ceph: fix duplicate increment of opened_inodes metric
stable inclusion from stable-v5.10.88 commit e0f06c32afb24d6bcb024334ff8c392221a312e2 bugzilla: 186058 https://gitee.com/openeuler/kernel/issues/I4QW6A Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=e0f06c32afb24d6bcb024334ff8c392221a312e2 -------------------------------- [ Upstream commit 973e5245 ] opened_inodes is incremented twice when the same inode is opened twice with O_RDONLY and O_WRONLY respectively. To reproduce, run this python script, then check the metrics: import os for _ in range(10000): fd_r = os.open('a', os.O_RDONLY) fd_w = os.open('a', os.O_WRONLY) os.close(fd_r) os.close(fd_w) Fixes: 1dd8d470 ("ceph: metrics for opened files, pinned caps and opened inodes") Signed-off-by: NHu Weiwen <sehuww@mail.scut.edu.cn> Reviewed-by: NXiubo Li <xiubli@redhat.com> Signed-off-by: NIlya Dryomov <idryomov@gmail.com> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NChen Jun <chenjun102@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Showing
想要评论请 注册 或 登录