From d84f55f3fe022dc11c1f8198c8275e0a1b967e12 Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Sat, 2 Apr 2016 15:14:25 -0400 Subject: [PATCH] rgw_file: fix attributes for "special" test cases 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 --- src/test/librgw_file_nfsns.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/librgw_file_nfsns.cc b/src/test/librgw_file_nfsns.cc index 1cc6a66532a..c5f483a362b 100644 --- a/src/test/librgw_file_nfsns.cc +++ b/src/test/librgw_file_nfsns.cc @@ -331,6 +331,14 @@ TEST(LibRGW, SETUP_DIRS1) { 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); -- 2.39.5