Bug 2291447

Summary: [RBD] "rbd du" fails if image created with 0 size
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Sunil Angadi <sangadi>
Component: RBDAssignee: Ilya Dryomov <idryomov>
Status: CLOSED ERRATA QA Contact: Sunil Angadi <sangadi>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.1CC: akraj, ceph-eng-bugs, cephqe-warriors, idryomov, mcaldeir, rpollack
Target Milestone: ---   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ceph-19.1.0-3 Doc Type: Bug Fix
Doc Text:
.`rbd du` command no longer crashes if a 0-sized block device image is encountered Previously, due to an implementation defect, `rbd du` command would crash if it encountered a 0-sized RBD image. With this fix, the implementation defect is fixed and the `rbd du` command no longer crashes if a 0-sized RBD image is encountered.
Story Points: ---
Clone Of:
: 2293933 2293935 2293936 (view as bug list) Environment:
Last Closed: 2024-11-25 09:01:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2317218    

Description Sunil Angadi 2024-06-12 07:30:54 UTC
Description of problem:
Created image with 0GB size 
rbd create rep_pool_SiLuJSPClg/image1 -s 0G

when try to check rbd du it fails as below

[root@ceph-rbd1-sangadi-01-ljut20-node2 ~]# rbd du -p rep_pool_SiLuJSPClg
/builddir/build/BUILD/ceph-18.2.1/src/librbd/api/DiffIterate.cc: In function 'int librbd::api::DiffIterate<ImageCtxT>::execute() [with ImageCtxT = librbd::ImageCtx]' thread 7fd64c428c00 time 2024-06-12T03:19:10.835518-0400
/builddir/build/BUILD/ceph-18.2.1/src/librbd/api/DiffIterate.cc: 341: FAILED ceph_assert(object_diff_state.size() == end_object_no - start_object_no)
 ceph version 18.2.1-194.el9cp (04a992766839cd3207877e518a1238cdbac3787e) reef (stable)
 1: (ceph::__ceph_assert_fail(char const*, char const*, int, char const*)+0x12e) [0x7fd64d763076]
 2: /usr/lib64/ceph/libceph-common.so.2(+0x163234) [0x7fd64d763234]
 3: /lib64/librbd.so.1(+0x195b44) [0x7fd64e395b44]
 4: /lib64/librbd.so.1(+0x5524d7) [0x7fd64e7524d7]
 5: (librbd::Image::diff_iterate2(char const*, unsigned long, unsigned long, bool, bool, int (*)(unsigned long, unsigned long, int, void*), void*)+0x94) [0x7fd64e308d24]
 6: rbd(+0x2de947) [0x55e28b304947]
 7: (rbd::action::disk_usage::execute(boost::program_options::variables_map const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)+0x1027) [0x55e28b172aa7]
 8: (rbd::Shell::execute(int, char const**)+0xc17) [0x55e28b1571e7]
 9: main()
 10: /lib64/libc.so.6(+0x29590) [0x7fd64ce29590]
 11: __libc_start_main()
 12: _start()
*** Caught signal (Aborted) **
 in thread 7fd64c428c00 thread_name:rbd
2024-06-12T03:19:10.835-0400 7fd64c428c00 -1 /builddir/build/BUILD/ceph-18.2.1/src/librbd/api/DiffIterate.cc: In function 'int librbd::api::DiffIterate<ImageCtxT>::execute() [with ImageCtxT = librbd::ImageCtx]' thread 7fd64c428c00 time 2024-06-12T03:19:10.835518-0400
/builddir/build/BUILD/ceph-18.2.1/src/librbd/api/DiffIterate.cc: 341: FAILED ceph_assert(object_diff_state.size() == end_object_no - start_object_no)

 ceph version 18.2.1-194.el9cp (04a992766839cd3207877e518a1238cdbac3787e) reef (stable)

Version-Release number of selected component (if applicable):
ceph version 18.2.1-194.el9cp (04a992766839cd3207877e518a1238cdbac3787e) reef (stable)

How reproducible:
Always

Steps to Reproduce:
1.Deploy ceph and create pool
2.create images with 0 size
3.check rbd du output for 0 sized image

Actual results:
/mnt/data/workspace/ceph_linux/src/librbd/api/DiffIterate.cc: In function 'int librbd::api::DiffIterate<ImageCtxT>::execute() [with ImageCtxT = librbd::ImageCtx]' thread 7fa28543f740 time 2024-06-11T07:51:39.470207+0000
/mnt/data/workspace/ceph_linux/src/librbd/api/DiffIterate.cc: 341: FAILED ceph_assert(object_diff_state.size() == end_object_no - start_object_no)

Expected results:
command should not error out

Additional info:
https://tracker.ceph.com/issues/66418

Comment 7 errata-xmlrpc 2024-11-25 09:01:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat Ceph Storage 8.0 security, bug fix, and enhancement updates), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2024:10216