Message ID | 20130812165247.74c66315@notabene.brown (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
T24gTW9uLCAyMDEzLTA4LTEyIGF0IDE2OjUyICsxMDAwLCBOZWlsQnJvd24gd3JvdGU6DQo+IA0K PiBBZnRlciByZWNsYWltaW5nIHN0YXRlIHRoYXQgd2FzIGxvc3QsIHRoZSBORlMgY2xpZW50IHRy aWVzIHRvIHJlY2xhaW0NCj4gYW55IGxvY2tzLCBhbmQgdGhlbiBjaGVja3MgdGhhdCBlYWNoIG9u ZSBoYXMgTkZTX0xPQ0tfSU5JVElBTElaRUQgc2V0DQo+ICh3aGljaCBtZWFucyB0aGF0IHRoZSBz ZXJ2ZXIgaGFzIGNvbmZpcm1lZCB0aGUgbG9jaykuDQo+IEhvd2V2ZXIgaWYgdGhlIGNsaWVudCBo b2xkcyBhIGRlbGVnYXRpb24sIG5mc19yZWNsYWltX2xvY2tzKCkgc2ltcGx5IGFib3J0cw0KPiAo b3IgbW9yZSBhY2N1cmF0ZWx5IGl0IGNhbGxlZCBuZnNfbG9ja19yZWNsYWltKCkgYW5kIHRoYXQg cmV0dXJucyB3aXRob3V0DQo+IGRvaW5nIGFueXRoaW5nKS4NCj4gDQo+IFRoaXMgaXMgYmVjYXVz ZSB3aGVuIGEgZGVsZWdhdGlvbiBpcyBoZWxkLCB0aGUgc2VydmVyIGRvZXNuJ3QgbmVlZCB0bw0K PiBrbm93IGFib3V0IGxvY2tzLg0KPiANCj4gU28gaWYgYSBkZWxlZ2F0aW9uIGlzIGhlbGQsIE5G U19MT0NLX0lOSVRJQUxJWkVEIGlzIG5vdCBleHBlY3RlZCwgYW5kDQo+IGl0cyBhYnNlbmNlIGlz IGNlcnRhaW5seSBub3QgYW4gZXJyb3IuDQo+IA0KPiBTbyBkb24ndCBwcmludCB0aGUgd2Fybmlu Z3MgaWYgTkZTX0RFTEdBVEVEX1NUQVRFIGlzIHNldC4NCj4gDQo+IFNpZ25lZC1vZmYtYnk6IE5l aWxCcm93biA8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E LCAmbG9jay0+bHNfZmxhZ3MpKQ0KPiArCQkJCQkJCXByX3dhcm5fcmF0ZWxpbWl0ZWQoIk5GUzog Ig0KPiArCQkJCQkJCQkJICAgICIlczogTG9jayByZWNsYWltICINCj4gKwkJCQkJCQkJCSAgICAi ZmFpbGVkIVxuIiwgX19mdW5jX18pOw0KPiArCQkJCQl9DQo+ICsJCQkJCXNwaW5fdW5sb2NrKCZz dGF0ZS0+c3RhdGVfbG9jayk7DQo+ICAJCQkJfQ0KPiAtCQkJCXNwaW5fdW5sb2NrKCZzdGF0ZS0+ c3RhdGVfbG9jayk7DQo+ICAJCQkJbmZzNF9wdXRfb3Blbl9zdGF0ZShzdGF0ZSk7DQo+ICAJCQkJ c3Bpbl9sb2NrKCZzcC0+c29fbG9jayk7DQo+ICAJCQkJZ290byByZXN0YXJ0Ow0KDQpUaGF0IGxv b2tzIGNvcnJlY3QgdG8gbWUuIEFwcGxpZWQuDQoNClRoYW5rcyBOZWlsIQ0KICBUcm9uZA0KLS0g DQpUcm9uZCBNeWtsZWJ1c3QNCkxpbnV4IE5GUyBjbGllbnQgbWFpbnRhaW5lcg0KDQpOZXRBcHAN ClRyb25kLk15a2xlYnVzdEBuZXRhcHAuY29tDQp3d3cubmV0YXBwLmNvbQ0K -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index e22862f..e4e063f 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -1443,14 +1443,16 @@ restart: if (status >= 0) { status = nfs4_reclaim_locks(state, ops); if (status >= 0) { - spin_lock(&state->state_lock); - list_for_each_entry(lock, &state->lock_states, ls_locks) { - if (!test_bit(NFS_LOCK_INITIALIZED, &lock->ls_flags)) - pr_warn_ratelimited("NFS: " - "%s: Lock reclaim " - "failed!\n", __func__); + if (test_bit(NFS_DELEGATED_STATE, &state->flags) != 0) { + spin_lock(&state->state_lock); + list_for_each_entry(lock, &state->lock_states, ls_locks) { + if (!test_bit(NFS_LOCK_INITIALIZED, &lock->ls_flags)) + pr_warn_ratelimited("NFS: " + "%s: Lock reclaim " + "failed!\n", __func__); + } + spin_unlock(&state->state_lock); } - spin_unlock(&state->state_lock); nfs4_put_open_state(state); spin_lock(&sp->so_lock); goto restart;
After reclaiming state that was lost, the NFS client tries to reclaim any locks, and then checks that each one has NFS_LOCK_INITIALIZED set (which means that the server has confirmed the lock). However if the client holds a delegation, nfs_reclaim_locks() simply aborts (or more accurately it called nfs_lock_reclaim() and that returns without doing anything). This is because when a delegation is held, the server doesn't need to know about locks. So if a delegation is held, NFS_LOCK_INITIALIZED is not expected, and its absence is certainly not an error. So don't print the warnings if NFS_DELGATED_STATE is set. Signed-off-by: NeilBrown <neilb@suse.de>