Description of problem: Code incorrectly fills in stat information for the directory being traversed for the parent dentry, "..". Version-Release number of selected component (if applicable): 3.0 How reproducible: 100% Steps to Reproduce: 1. Compile this C++ program: > #include <assert.h> > #include <string.h> > #include <stddef.h> > #include <dirent.h> > #include "include/cephfs/libcephfs.h" > > int main (int argc, char *argv[]) > { > struct ceph_mount_info *admin; > > int r = ceph_create(&admin, NULL); > if (r < 0) > return r; > ceph_conf_read_file(admin, NULL); > ceph_conf_parse_env(admin, NULL); > r = ceph_mount(admin, "/"); > if (r < 0) > return r; > > ceph_mkdir(admin, "foo", 0777); > struct ceph_statx fb; > ceph_statx(admin, "/foo", &fb, CEPH_STATX_INO, 0); > struct ceph_dir_result *dirp; > ceph_opendir(admin, "foo", &dirp); > struct ceph_statx b; > struct dirent de; > while (ceph_readdirplus_r(admin, dirp, &de, &b, CEPH_STATX_INO, 0, NULL)) { > if (strcmp("..", de.d_name) == 0) { > assert(fb.stx_ino != b.stx_ino); > break; > } > } > > ceph_shutdown(admin); > return 0; > } 2. Run the program, it should not assert. Actual results: > sh-4.2# ./test > test: /ceph/test.c:29: int main(int, char**): Assertion `fb.stx_ino != b.stx_ino' failed. > Aborted (core dumped) Expected results: > sh-4.2# ./test > sh-4.2# Additional info:
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, 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-2018:2375