Bug 1594616 - CephFS client library (ceph-fuse) gives stats for "." instead of the parent for the ".." dentry during readdir traversal
Summary: CephFS client library (ceph-fuse) gives stats for "." instead of the parent f...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat
Component: CephFS
Version: 3.0
Hardware: All
OS: All
low
low
Target Milestone: z5
: 3.0
Assignee: Patrick Donnelly
QA Contact: Vasishta
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-25 01:31 UTC by Patrick Donnelly
Modified: 2018-08-09 18:27 UTC (History)
5 users (show)

Fixed In Version: RHEL: ceph-12.2.4-32 Ubuntu: ceph_12.2.4-36redhat1xenial
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-08-09 18:27:13 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Ceph Project Bug Tracker 22936 None None None 2018-06-25 01:31:12 UTC
Red Hat Product Errata RHBA-2018:2375 None None None 2018-08-09 18:27:32 UTC

Description Patrick Donnelly 2018-06-25 01:31:12 UTC
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:

Comment 10 errata-xmlrpc 2018-08-09 18:27:13 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, 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


Note You need to log in before you can comment on or make changes to this bug.