From: Hongchao Zhang Date: Fri, 8 Nov 2024 19:07:35 +0000 (-0800) Subject: LU-17985 osd-ldiskfs: drop osd object if failed to create X-Git-Tag: 2.15.6-RC1~12 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=6b5bd48a7a0896e6eea00dd0b982ea2a08040f03;p=fs%2Flustre-release.git LU-17985 osd-ldiskfs: drop osd object if failed to create In osd_create, if the newly created inode had already contained correct XATTR_NAME_LMA but failed to update the OI, it will clear osd_object->oo_inode, the osd_object should also be dropped. Lustre-change: https://review.whamcloud.com/55571 Lustre-commit: 40e27b4251bec6d60ce0a6310a5ac7094980f9a3 Signed-off-by: Hongchao Zhang Change-Id: I4ff5952c154ce459c78514b88b1810471635c703 Reviewed-by: Andreas Dilger Reviewed-by: Alex Zhuravlev Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56940 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index 7317a7e..379cec4 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -4275,6 +4275,10 @@ static int osd_create(const struct lu_env *env, struct dt_object *dt, result = __osd_oi_insert(env, obj, fid, th); if (result && inode) { + set_bit(LU_OBJECT_HEARD_BANSHEE, + &obj->oo_dt.do_lu.lo_header->loh_flags); + obj->oo_dt.do_lu.lo_header->loh_attr &= ~LOHA_EXISTS; + spin_lock(&obj->oo_guard); clear_nlink(inode); spin_unlock(&obj->oo_guard);