If a caller does an atomic create using rgw_lookup() and
RGW_LOOKUP_FLAG_CREATE, it needs to fix up the attributes using
create_stat().
For use outside of test cases, it probably needs an interlock also,
but for now, do just enough to satisfy existing attribute checks.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
ASSERT_EQ(rc, 0);
sf.sync();
ASSERT_TRUE(sf.rgw_fh->is_file());
+
+ /* because we made it the hard way, fixup attributes */
+ struct stat st;
+ st.st_uid = owner_uid;
+ st.st_gid = owner_gid;
+ st.st_mode = 644;
+ sf.rgw_fh->create_stat(&st, create_mask);
+
/* open handle */
rc = rgw_open(fs, sf.fh, 0 /* flags */);
ASSERT_EQ(rc, 0);