]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: make the lost+found dir accessible from clients
authorXiubo Li <xiubli@redhat.com>
Mon, 19 Apr 2021 02:34:02 +0000 (10:34 +0800)
committerNathan Cutler <ncutler@suse.com>
Wed, 12 May 2021 16:25:14 +0000 (18:25 +0200)
Inode number 0x4 is reserved for the lost+found dir, and the apps
or recovery apps need to access it.

At the same time the 0x3 is reserved for the global snaprealm, which
will also be lookup by the clients when looking up the snaprealm inodes.

Here will make all the inode less than 100 accessible by clients.

Fixes: https://tracker.ceph.com/issues/50216
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit 841071b3602aa2b8bcca57b95cdf671d48036a34)

Conflicts:
src/mds/Server.cc
- code being changed does not exist in octopus: change omitted
        src/mds/mdstypes.h
- trivial resolution

src/client/Client.cc
src/mds/mdstypes.h

index 7a94f37fc3fb6316fe1027033639fb239d32dbff..16f9b58586ce53c90cea25369e5b924623879e83 100755 (executable)
@@ -132,8 +132,8 @@ void client_flush_set_callback(void *p, ObjectCacher::ObjectSet *oset)
 }
 
 bool Client::is_reserved_vino(vinodeno_t &vino) {
-  if (vino.ino < MDS_INO_SYSTEM_BASE && vino.ino != CEPH_INO_ROOT) {
-    ldout(cct, -1) << __func__ << "attempt to access reserved inode number " << vino << dendl;
+  if (MDS_IS_PRIVATE_INO(vino.ino)) {
+    ldout(cct, -1) << __func__ << " attempt to access reserved inode number " << vino << dendl;
     return true;
   }
   return false;
index 33f9496e77d4a229b28e0153d72f487f20afd1bf..06d90461a446bb8e1f7fc5e1a55b9d6dbdc33339 100644 (file)
 #define MDS_INO_STRAY_OWNER(i) (signed (((unsigned (i)) - MDS_INO_STRAY_OFFSET) / NUM_STRAY))
 #define MDS_INO_STRAY_INDEX(i) (((unsigned (i)) - MDS_INO_STRAY_OFFSET) % NUM_STRAY)
 
+#define MDS_IS_PRIVATE_INO(i) ((i) < MDS_INO_SYSTEM_BASE && (i) >= MDS_INO_MDSDIR_OFFSET)
+
 #define MDS_TRAVERSE_FORWARD       1
 #define MDS_TRAVERSE_DISCOVER      2    // skips permissions checks etc.
 #define MDS_TRAVERSE_DISCOVERXLOCK 3    // succeeds on (foreign?) null, xlocked dentries.
 
-
 typedef int32_t mds_rank_t;
 constexpr mds_rank_t MDS_RANK_NONE = -1;