Whamcloud - gitweb
LU-17985 osd-ldiskfs: drop osd object if failed to create 40/56940/2
authorHongchao Zhang <hongchao@whamcloud.com>
Fri, 8 Nov 2024 19:07:35 +0000 (11:07 -0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 18 Nov 2024 17:42:11 +0000 (17:42 +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.

Lustre-change: https://review.whamcloud.com/55571
Lustre-commit: 40e27b4251bec6d60ce0a6310a5ac7094980f9a3

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

index 7317a7e..379cec4 100644 (file)
@@ -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);