Skip to content
Commit e0f06c32 authored by Hu Weiwen's avatar Hu Weiwen Committed by Greg Kroah-Hartman
Browse files

ceph: fix duplicate increment of opened_inodes metric



[ 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: default avatarHu Weiwen <sehuww@mail.scut.edu.cn>
Reviewed-by: default avatarXiubo Li <xiubli@redhat.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 640e28d6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment