Skip to content

Commit b4c65dc

Browse files
authored
Merge pull request ceph#62684 from mchangir/mds-use-already-avaialble-CInode-in-uninline-path
mds: use available CInode* for uninline data Reviewed-by: Venky Shankar <[email protected]>
2 parents 9abd01f + 0ea8570 commit b4c65dc

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/mds/MDCache.cc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13497,7 +13497,7 @@ class C_MDC_DataUninlinedSubmitted : public MDCacheLogContext {
1349713497

1349813498
void finish(int r) {
1349913499
auto mds = get_mds(); // to keep dout happy
13500-
auto in = mds->server->rdlock_path_pin_ref(mdr, true);
13500+
auto in = mdr->in[0];
1350113501

1350213502
ceph_assert(in != nullptr);
1350313503

@@ -13514,6 +13514,7 @@ class C_MDC_DataUninlinedSubmitted : public MDCacheLogContext {
1351413514
h->record_uninline_passed();
1351513515
in->uninline_finished();
1351613516
mdr->apply();
13517+
in->auth_unpin(this); // for uninline data
1351713518
mds->server->respond_to_request(mdr, r);
1351813519
}
1351913520
};
@@ -13530,7 +13531,9 @@ struct C_IO_DataUninlined : public MDSIOContext {
1353013531

1353113532
void finish(int r) override {
1353213533
auto mds = get_mds(); // to keep dout/derr happy
13533-
auto in = mds->server->rdlock_path_pin_ref(mdr, true);
13534+
auto in = mdr->in[0];
13535+
13536+
ceph_assert(in != nullptr);
1353413537

1353513538
// return faster if operation has failed (non-zero) status
1353613539
if (r) {
@@ -13544,6 +13547,7 @@ struct C_IO_DataUninlined : public MDSIOContext {
1354413547
in->make_path_string(path);
1354513548
h->record_uninline_status(in->ino(), r, path);
1354613549
in->uninline_finished();
13550+
in->auth_unpin(this); // for uninline data
1354713551
mds->server->respond_to_request(mdr, r);
1354813552
return;
1354913553
}
@@ -13585,11 +13589,9 @@ struct C_IO_DataUninlined : public MDSIOContext {
1358513589

1358613590
void MDCache::uninline_data_work(MDRequestRef mdr)
1358713591
{
13588-
CInode *in = mds->server->rdlock_path_pin_ref(mdr, true);
13592+
CInode *in = mdr->in[0];
1358913593

13590-
if (!in) {
13591-
return;
13592-
}
13594+
ceph_assert(in != nullptr);
1359313595

1359413596
MutationImpl::LockOpVec lov;
1359513597
lov.add_xlock(&in->authlock);
@@ -13604,6 +13606,7 @@ void MDCache::uninline_data_work(MDRequestRef mdr)
1360413606
if (!in->has_inline_data()) {
1360513607
dout(20) << "(uninline_data) inode doesn't have inline data anymore " << *in << dendl;
1360613608
in->uninline_finished();
13609+
in->auth_unpin(this); // for uninline_data
1360713610
mds->server->respond_to_request(mdr, 0);
1360813611
return;
1360913612
}

src/mds/ScrubStack.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,9 @@ void ScrubStack::uninline_data(CInode *in, Context *fin)
13821382
mdr->snapid = CEPH_NOSNAP;
13831383
mdr->no_early_reply = true;
13841384
mdr->internal_op_finish = fin;
1385+
mdr->in[0] = in;
13851386

1387+
in->auth_pin(this);
13861388
in->mdcache->dispatch_request(mdr);
13871389
}
13881390

0 commit comments

Comments
 (0)