]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw_file: rgw_readdir: return dot-dirs only when *offset is 0
authorMatt Benjamin <mbenjamin@redhat.com>
Wed, 15 Mar 2017 20:40:35 +0000 (16:40 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Thu, 16 Mar 2017 15:43:55 +0000 (11:43 -0400)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/rgw_file.cc

index 3bde20bad4daea6fe2393b1a91f515ba83bcd543..67161e54298072bea181af46d4f4e104e62f2b48 100644 (file)
@@ -883,7 +883,8 @@ namespace rgw {
 
     (void) clock_gettime(CLOCK_MONOTONIC_COARSE, &now); /* !LOCKED */
 
-    if (flags & RGW_READDIR_FLAG_DOTDOT) {
+    if ((*offset == 0) &&
+       (flags & RGW_READDIR_FLAG_DOTDOT)) {
       /* send '.' and '..' with their NFS-defined offsets */
       rcb(".", cb_arg, 1);
       rcb("..", cb_arg, 2);