diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-10-06 12:01:45 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-10-06 12:01:45 -0400 |
| commit | b77779b93d7a38d9a7f3462b83f6e6fadb6b9ce5 (patch) | |
| tree | 4069743339aeca5a77a58eedb694621471af4683 | |
| parent | 8d4ef4e15ec57eec5d24fb109fbc220eea9f0caf (diff) | |
| parent | 38f340ccdf9ed5f1350505b46c5689d015967057 (diff) | |
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
| -rw-r--r-- | fs/ceph/mds_client.c | 11 | ||||
| -rw-r--r-- | fs/ceph/snap.c | 8 |
2 files changed, 9 insertions, 10 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 84edfc60d87a..f23c820daaed 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
| @@ -734,12 +734,13 @@ static int __choose_mds(struct ceph_mds_client *mdsc, | |||
| 734 | inode = req->r_inode; | 734 | inode = req->r_inode; |
| 735 | ihold(inode); | 735 | ihold(inode); |
| 736 | } else { | 736 | } else { |
| 737 | /* req->r_dentry is non-null for LSSNAP request. | 737 | /* req->r_dentry is non-null for LSSNAP request */ |
| 738 | * fall-thru */ | 738 | rcu_read_lock(); |
| 739 | WARN_ON_ONCE(!req->r_dentry); | 739 | inode = get_nonsnap_parent(req->r_dentry); |
| 740 | rcu_read_unlock(); | ||
| 741 | dout("__choose_mds using snapdir's parent %p\n", inode); | ||
| 740 | } | 742 | } |
| 741 | } | 743 | } else if (req->r_dentry) { |
| 742 | if (!inode && req->r_dentry) { | ||
| 743 | /* ignore race with rename; old or new d_parent is okay */ | 744 | /* ignore race with rename; old or new d_parent is okay */ |
| 744 | struct dentry *parent; | 745 | struct dentry *parent; |
| 745 | struct inode *dir; | 746 | struct inode *dir; |
diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c index 1ffc8b426c1c..7fc0b850c352 100644 --- a/fs/ceph/snap.c +++ b/fs/ceph/snap.c | |||
| @@ -374,12 +374,10 @@ static int build_snap_context(struct ceph_snap_realm *realm, | |||
| 374 | realm->ino, realm, snapc, snapc->seq, | 374 | realm->ino, realm, snapc, snapc->seq, |
| 375 | (unsigned int) snapc->num_snaps); | 375 | (unsigned int) snapc->num_snaps); |
| 376 | 376 | ||
| 377 | if (realm->cached_context) { | 377 | ceph_put_snap_context(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 | } | ||
| 382 | realm->cached_context = snapc; | 378 | realm->cached_context = snapc; |
| 379 | /* queue realm for cap_snap creation */ | ||
| 380 | list_add_tail(&realm->dirty_item, dirty_realms); | ||
| 383 | return 0; | 381 | return 0; |
| 384 | 382 | ||
| 385 | fail: | 383 | fail: |
