@@ -1811,28 +1811,6 @@ static int rgw_bucket_link_olh(cls_method_context_t hctx, bufferlist *in, buffer
18111811 return ret;
18121812 }
18131813
1814- BIOLHEntry olh (hctx, op.key );
1815- bool olh_read_attempt = false ;
1816- bool olh_found = false ;
1817- if (!existed && op.delete_marker ) {
1818- /* read olh */
1819- ret = olh.init (&olh_found);
1820- if (ret < 0 ) {
1821- return ret;
1822- }
1823- olh_read_attempt = true ;
1824-
1825- // if we're deleting (i.e., adding a delete marker, and the OLH
1826- // indicates it already refers to a delete marker, error out)
1827- if (olh_found && olh.get_entry ().delete_marker ) {
1828- CLS_LOG (10 ,
1829- " %s: delete marker received for \" %s\" although OLH"
1830- " already refers to a delete marker" ,
1831- __func__, escape_str (op.key .to_string ()).c_str ());
1832- return -ENOENT;
1833- }
1834- }
1835-
18361814 if (existed && !real_clock::is_zero (op.unmod_since )) {
18371815 timespec mtime = ceph::real_clock::to_timespec (obj.mtime ());
18381816 timespec unmod = ceph::real_clock::to_timespec (op.unmod_since );
@@ -1885,12 +1863,11 @@ static int rgw_bucket_link_olh(cls_method_context_t hctx, bufferlist *in, buffer
18851863 }
18861864
18871865 /* read olh */
1888- if (!olh_read_attempt) { // only read if we didn't attempt earlier
1889- ret = olh.init (&olh_found);
1890- if (ret < 0 ) {
1891- return ret;
1892- }
1893- olh_read_attempt = true ;
1866+ BIOLHEntry olh (hctx, op.key );
1867+ bool olh_found = false ;
1868+ ret = olh.init (&olh_found);
1869+ if (ret < 0 ) {
1870+ return ret;
18941871 }
18951872
18961873 const uint64_t prev_epoch = olh.get_epoch ();
0 commit comments