mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
ceph: don't skip updating wanted caps when cap is stale
[ Upstream commit 0aa971b6fd3f92afef6afe24ef78d9bb14471519 ] 1. try_get_cap_refs() fails to get caps and finds that mds_wanted does not include what it wants. It returns -ESTALE. 2. ceph_get_caps() calls ceph_renew_caps(). ceph_renew_caps() finds that inode has cap, so it calls ceph_check_caps(). 3. ceph_check_caps() finds that issued caps (without checking if it's stale) already includes caps wanted by open file, so it skips updating wanted caps. Above events can cause an infinite loop inside ceph_get_caps(). Signed-off-by: "Yan, Zheng" <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
acbfccc6a3
commit
b71ac8086a
1 changed files with 6 additions and 2 deletions
|
|
@ -1976,8 +1976,12 @@ retry_locked:
|
|||
}
|
||||
|
||||
/* want more caps from mds? */
|
||||
if (want & ~(cap->mds_wanted | cap->issued))
|
||||
goto ack;
|
||||
if (want & ~cap->mds_wanted) {
|
||||
if (want & ~(cap->mds_wanted | cap->issued))
|
||||
goto ack;
|
||||
if (!__cap_is_valid(cap))
|
||||
goto ack;
|
||||
}
|
||||
|
||||
/* things we might delay */
|
||||
if ((cap->issued & ~retain) == 0)
|
||||
|
|
|
|||
Loading…
Reference in a new issue