Whamcloud - gitweb
LU-17985 osd-ldiskfs: drop osd object if failed to create 71/55571/4
authorHongchao Zhang <hongchao@whamcloud.com>
Fri, 21 Jun 2024 21:51:31 +0000 (05:51 +0800)
committerOleg Drokin <green@whamcloud.com>
Sat, 13 Jul 2024 20:54:56 +0000 (20:54 +0000)
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.

Signed-off-by: Hongchao Zhang <hongchao@whamcloud.com>
Change-Id: I4ff5952c154ce459c78514b88b1810471635c703
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55571
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
lustre/osd-ldiskfs/osd_handler.c

index e9f3eef..d252df3 100644 (file)
@@ -4459,6 +4459,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);