Project

General

Profile

Bug #57342

kclient: incorrectly showing the size for snapdirs when stating them

Added by Xiubo Li 5 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Crash signature (v1):
Crash signature (v2):

Description

There are 4 snapshots under the /mnt/kcephfs/.snap/:

[root@lxbceph1 kcephfs]# ls /mnt/kcephfs/.snap/
ddd  fff  fffd  snap3

But when stating the /mnt/kcephfs/.snap/ directory, I hit one time it show as -2:

[root@lxbceph1 kcephfs]# stat /mnt/kcephfs/.snap/
  File: .snap/
  Size: -2            Blocks: 0          IO Block: 65536  directory
Device: 0h/0d    Inode: 1           Links: 1
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Context: system_u:object_r:cephfs_t:s0
Access: 1970-01-01 08:00:00.000000000 +0800
Modify: 2022-08-31 07:51:02.242181796 +0800
Change: 2022-08-31 07:51:02.242181796 +0800
 Birth: 2022-08-31 07:50:19.681478483 +0800

But mostly it will show as 0:

[root@lxbceph1 kcephfs]# stat /mnt/kcephfs/.snap
  File: .snap
  Size: 0             Blocks: 0          IO Block: 65536  directory
Device: 0h/0d    Inode: 1           Links: 2
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Context: system_u:object_r:cephfs_t:s0
Access: 1970-01-01 08:00:00.000000000 +0800
Modify: 2022-08-31 10:54:27.883476991 +0800
Change: 2022-08-31 10:54:27.883476991 +0800
 Birth: 2022-08-31 09:39:50.856553467 +0800

But 4 is as expected.


Related issues

Copied to CephFS - Bug #57344: libcephfs: incorrectly showing the size for snapdirs when stating them Pending Backport

History

#1 Updated by Xiubo Li 5 months ago

  • Status changed from New to In Progress

#2 Updated by Xiubo Li 5 months ago

  • Copied to Bug #57344: libcephfs: incorrectly showing the size for snapdirs when stating them added

#3 Updated by Xiubo Li 5 months ago

  • Status changed from In Progress to Fix Under Review

Patchwork:
ceph: fix incorrectly showing the .snap size for stat
https://patchwork.kernel.org/project/ceph-devel/patch/20220831080257.170065-1-xiubli@redhat.com/

#5 Updated by Xiubo Li 3 months ago

  • Status changed from Fix Under Review to Resolved

Also available in: Atom PDF