Skip to content

Commit b77779b

Browse files
committed
Merge tag 'ceph-for-4.14-rc4' of git://github.com/ceph/ceph-client
Pull ceph fixes from Ilya Dryomov: "Two fixups for CephFS snapshot-handling patches in -rc1" * tag 'ceph-for-4.14-rc4' of git://github.com/ceph/ceph-client: ceph: fix __choose_mds() for LSSNAP request ceph: properly queue cap snap for newly created snap realm
2 parents 8d4ef4e + 38f340c commit b77779b

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

fs/ceph/mds_client.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -734,12 +734,13 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
734734
inode = req->r_inode;
735735
ihold(inode);
736736
} else {
737-
/* req->r_dentry is non-null for LSSNAP request.
738-
* fall-thru */
739-
WARN_ON_ONCE(!req->r_dentry);
737+
/* req->r_dentry is non-null for LSSNAP request */
738+
rcu_read_lock();
739+
inode = get_nonsnap_parent(req->r_dentry);
740+
rcu_read_unlock();
741+
dout("__choose_mds using snapdir's parent %p\n", inode);
740742
}
741-
}
742-
if (!inode && req->r_dentry) {
743+
} else if (req->r_dentry) {
743744
/* ignore race with rename; old or new d_parent is okay */
744745
struct dentry *parent;
745746
struct inode *dir;

fs/ceph/snap.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,12 +374,10 @@ static int build_snap_context(struct ceph_snap_realm *realm,
374374
realm->ino, realm, snapc, snapc->seq,
375375
(unsigned int) snapc->num_snaps);
376376

377-
if (realm->cached_context) {
378-
ceph_put_snap_context(realm->cached_context);
379-
/* queue realm for cap_snap creation */
380-
list_add_tail(&realm->dirty_item, dirty_realms);
381-
}
377+
ceph_put_snap_context(realm->cached_context);
382378
realm->cached_context = snapc;
379+
/* queue realm for cap_snap creation */
380+
list_add_tail(&realm->dirty_item, dirty_realms);
383381
return 0;
384382

385383
fail:

0 commit comments

Comments
 (0)