Whamcloud - gitweb
LU-15902 obdclass: dt_try_as_dir() check dir exists 83/47483/7
authorLai Siyao <lai.siyao@whamcloud.com>
Thu, 19 May 2022 22:31:07 +0000 (18:31 -0400)
committerOleg Drokin <green@whamcloud.com>
Mon, 18 Jul 2022 20:24:59 +0000 (20:24 +0000)
commit1ebc9ed460922e6fcf2432f70f2f6412974e963a
treedacfd5bffbfb6f19e19e6a5383b60abfdba7bdd9
parent40daa59ac41f450b60b42eb2bb0ff42ebd3c998b
LU-15902 obdclass: dt_try_as_dir() check dir exists

If an object is not directory, but dt_lookup() is called on it, it
may crash because .do_lookup is NULL for non-directory file.

Add argument to check object existence and type in dt_try_as_dir(),
and for object to create, skip this check.

Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: I51df0cbb5a4e7abca370ee27dac678f995b76159
Reviewed-on: https://review.whamcloud.com/47483
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 files changed:
lustre/include/dt_object.h
lustre/lfsck/lfsck_bookmark.c
lustre/lfsck/lfsck_engine.c
lustre/lfsck/lfsck_layout.c
lustre/lfsck/lfsck_lib.c
lustre/lfsck/lfsck_namespace.c
lustre/lfsck/lfsck_striped_dir.c
lustre/lod/lod_object.c
lustre/mdd/mdd_dir.c
lustre/mdd/mdd_internal.h
lustre/mdd/mdd_object.c
lustre/mdd/mdd_orphans.c
lustre/mgs/mgs_fs.c
lustre/obdclass/dt_object.c
lustre/obdclass/llog_osd.c
lustre/obdclass/local_storage.c
lustre/obdclass/scrub.c
lustre/quota/lquota_disk.c
lustre/target/out_handler.c
lustre/target/out_lib.c
lustre/target/update_recovery.c