Whamcloud - gitweb
LU-14575 ofd: suppress errors on missing parent FID 84/43184/2
authorJohn L. Hammond <jhammond@whamcloud.com>
Wed, 31 Mar 2021 17:45:05 +0000 (12:45 -0500)
committerOleg Drokin <green@whamcloud.com>
Sat, 10 Apr 2021 17:40:53 +0000 (17:40 +0000)
In ofd_access(), if the parent FID is zero then skip adding an entry
to the OFD access log.

Signed-off-by: John L. Hammond <jhammond@whamcloud.com>
Change-Id: Ib518dc1f181a820d99021dd58ab548916e16f29d
Reviewed-on: https://review.whamcloud.com/43184
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ofd/ofd_access_log.c

index 706cdbf..791d027 100644 (file)
@@ -516,6 +516,10 @@ void ofd_access(const struct lu_env *env,
        unsigned int flags = (rw == READ) ? OFD_ACCESS_READ : OFD_ACCESS_WRITE;
        struct ofd_access_log *oal = m->ofd_access_log;
 
        unsigned int flags = (rw == READ) ? OFD_ACCESS_READ : OFD_ACCESS_WRITE;
        struct ofd_access_log *oal = m->ofd_access_log;
 
+       /* obdfilter-survey does not set parent FIDs. */
+       if (fid_is_zero(parent_fid))
+               return;
+
        if (oal && (flags & m->ofd_access_log_mask)) {
                struct ofd_access_entry_v1 oae = {
                        .oae_parent_fid = *parent_fid,
        if (oal && (flags & m->ofd_access_log_mask)) {
                struct ofd_access_entry_v1 oae = {
                        .oae_parent_fid = *parent_fid,
@@ -526,12 +530,13 @@ void ofd_access(const struct lu_env *env,
                        .oae_segment_count = segment_count,
                        .oae_flags = flags,
                };
                        .oae_segment_count = segment_count,
                        .oae_flags = flags,
                };
+               struct lu_seq_range range = {
+                       .lsr_flags = LU_SEQ_RANGE_ANY,
+               };
                struct oal_circ_buf *ocb;
                struct oal_circ_buf *ocb;
-               struct lu_seq_range range;
                int rc;
 
                /* learn target MDT from FID's sequence */
                int rc;
 
                /* learn target MDT from FID's sequence */
-               range.lsr_flags = LU_SEQ_RANGE_ANY;
                rc = fld_server_lookup(env, m->ofd_seq_site.ss_server_fld,
                                       fid_seq(parent_fid), &range);
                if (unlikely(rc))
                rc = fld_server_lookup(env, m->ofd_seq_site.ss_server_fld,
                                       fid_seq(parent_fid), &range);
                if (unlikely(rc))