Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-20462 Lustre Find Utility (LFU)
  3. LU-20611

Utils: lfind, the server-side find command for a Lustre target

XMLWordPrintable

    • Icon: Technical task Technical task
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • None
    • 3
    • 9223372036854775807

      lfind(8) is find for a Lustre target: it answers the questions lfs find
      answers, about uid, mtime, size, type and project id, by reading a
      target's own objects off the device rather than walking a mounted
      namespace.

      Where it runs

      On the MDS or OSS holding the target, and only there: the server package
      alone installs it, and a Lustre client has no target to read. It needs no
      mount, no MDS process and no client, so a snapshot or a failover partner's
      LUN scans like a serving one. It is root only, because reading the device
      bypasses every access control a mount applies. The objects come from
      llapi_scan_device() (LU-20606).

      Naming the target

      ```
      lfind --device /dev/vdb --uid 1000 --mtime +30
      lfind --target testfs-MDT0000 --type f --size +1G
      lfind --local --projid 1999
      ```
      A device always works, and needs nothing mounted. A target name resolves
      through osd-ldiskfs.NAME.mntdev, which exists only while that target is
      mounted here. The local form takes every target the node serves, skipping
      the MGS, and reports a target that fails without ending the sweep.

      Not a mode on lfs find

      That is a client command by construction: llapi_is_lustre_mnt() requires
      ":/" in the mount's device name, so a server target mount is not
      recognised and lfs find answers ENODEV there. lfs also ships in
      lustre-client, where the scan backend does not. The predicates are shared
      rather than copied: the option table and its parse loop move out of
      lfs_find() into a file compiled into both programs, as callvpe.c is. No
      new export, no ABI change.

      What differs, documented in lfind(8)

      It prints FIDs, a target having names and parent FIDs but no paths, so a
      name match reads the link xattr and printf formats are refused. One
      invocation covers one target, which under DNE is part of a namespace and
      not all of it. Size and blocks are size on MDT's answer or none, since a
      scan cannot glimpse, and an object nothing can settle is reported
      undecided. The ost, mdt and xattr predicates need the mounted filesystem
      and are refused before the scan starts.

      Acceptance

      The 56 series in sanity.sh stays green, which is the proof that moving the
      parser and splitting cb_find_init() changed nothing, and conf-sanity
      test_165 diffs a regular file scan against what the client saw on a
      stopped filesystem.

            hnishida Hiroshi Nishida
            hnishida Hiroshi Nishida
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: