All of lore.kernel.org
 help / color / mirror / Atom feed
* regression from commit 24408f5282
@ 2017-01-26 20:01 Olga Kornievskaia
  2017-01-26 20:57 ` [PATCH] pNFS: Fix a reference leak in _pnfs_return_layout Trond Myklebust
  2017-01-26 20:58 ` regression from commit 24408f5282 Trond Myklebust
  0 siblings, 2 replies; 4+ messages in thread
From: Olga Kornievskaia @ 2017-01-26 20:01 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs

Hi Trond,

There is regression in the upstream code, it leaves dangling DS
mounts. Problem didn't exist in 4.9 and appeared in 4.10.

Simple test is : mount, echo 1 > /mnt/foobar, unmount /mnt. Watch the
DS mount keep going.

The last commit at which the code works is: fe1cf9469d7 "pNFS: Clear
all layout segment state in pnfs_mark_layout_stateaid_invalid".

Applying commit 24408f5282 "pNFS: Fix bugs in _pnfs_return_layout"
introduces the problem.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] pNFS: Fix a reference leak in _pnfs_return_layout
  2017-01-26 20:01 regression from commit 24408f5282 Olga Kornievskaia
@ 2017-01-26 20:57 ` Trond Myklebust
  2017-01-26 20:58 ` regression from commit 24408f5282 Trond Myklebust
  1 sibling, 0 replies; 4+ messages in thread
From: Trond Myklebust @ 2017-01-26 20:57 UTC (permalink / raw)
  To: Olga Kornievskaia; +Cc: linux-nfs

IF NFS_LAYOUT_RETURN_REQUESTED is not set, then we currently exit
without freeing the list of invalidated layout segments, leading
to a reference leak.

Reported-by: Olga Kornievskaia <aglo@umich.edu>
Fixes: 24408f5282 ("pNFS: Fix bugs in _pnfs_return_layout")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
---
 fs/nfs/pnfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 59554f3adf29..dd042498ce7c 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1200,10 +1200,10 @@ _pnfs_return_layout(struct inode *ino)
 
 	send = pnfs_prepare_layoutreturn(lo, &stateid, NULL);
 	spin_unlock(&ino->i_lock);
-	pnfs_free_lseg_list(&tmp_list);
 	if (send)
 		status = pnfs_send_layoutreturn(lo, &stateid, IOMODE_ANY, true);
 out_put_layout_hdr:
+	pnfs_free_lseg_list(&tmp_list);
 	pnfs_put_layout_hdr(lo);
 out:
 	dprintk("<-- %s status: %d\n", __func__, status);
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: regression from commit 24408f5282
  2017-01-26 20:01 regression from commit 24408f5282 Olga Kornievskaia
  2017-01-26 20:57 ` [PATCH] pNFS: Fix a reference leak in _pnfs_return_layout Trond Myklebust
@ 2017-01-26 20:58 ` Trond Myklebust
  2017-01-26 21:20   ` Olga Kornievskaia
  1 sibling, 1 reply; 4+ messages in thread
From: Trond Myklebust @ 2017-01-26 20:58 UTC (permalink / raw)
  To: aglo; +Cc: linux-nfs

T24gVGh1LCAyMDE3LTAxLTI2IGF0IDE1OjAxIC0wNTAwLCBPbGdhIEtvcm5pZXZza2FpYSB3cm90
ZToNCj4gSGkgVHJvbmQsDQo+IA0KPiBUaGVyZSBpcyByZWdyZXNzaW9uIGluIHRoZSB1cHN0cmVh
bSBjb2RlLCBpdCBsZWF2ZXMgZGFuZ2xpbmcgRFMNCj4gbW91bnRzLiBQcm9ibGVtIGRpZG4ndCBl
eGlzdCBpbiA0LjkgYW5kIGFwcGVhcmVkIGluIDQuMTAuDQo+IA0KPiBTaW1wbGUgdGVzdCBpcyA6
IG1vdW50LCBlY2hvIDEgPiAvbW50L2Zvb2JhciwgdW5tb3VudCAvbW50LiBXYXRjaCB0aGUNCj4g
RFMgbW91bnQga2VlcCBnb2luZy4NCj4gDQo+IFRoZSBsYXN0IGNvbW1pdCBhdCB3aGljaCB0aGUg
Y29kZSB3b3JrcyBpczogZmUxY2Y5NDY5ZDcgInBORlM6IENsZWFyDQo+IGFsbCBsYXlvdXQgc2Vn
bWVudCBzdGF0ZSBpbiBwbmZzX21hcmtfbGF5b3V0X3N0YXRlYWlkX2ludmFsaWQiLg0KPiANCj4g
QXBwbHlpbmcgY29tbWl0IDI0NDA4ZjUyODIgInBORlM6IEZpeCBidWdzIGluIF9wbmZzX3JldHVy
bl9sYXlvdXQiDQo+IGludHJvZHVjZXMgdGhlIHByb2JsZW0uDQo+IA0KPiBGcm9tIHdoYXQgSSBj
YW4gdGVsbCB0aGUgY29kZSBpcyBlaXRoZXIgbWlzc2luZyBzZXR0aW5nDQo+IE5GU19MQVlPVVRf
UkVUVVJOX1JFUVVFU1RFRCBzb21ld2hlcmUgYnV0IEknbSBub3Qgc3VyZS4NCj4gDQo+IE9yIGlm
IHRoZSBpbnRlbnQgd2FzIHRvIGp1c3QgbmV2ZXIgcmV0dXJuIHRoZSBsYXlvdXQgZXZlbiBvbiB0
aGUNCj4gdW5tb3VudCwgdGhlbiB3ZSBuZWVkIHRvIGRyb3AgdGhlIHJlZiBjb3VudCBvbiB0aGUg
bGF5b3V0IGhlcmUgc28NCj4gdGhhdA0KPiB1bm1vdW50IGNhbiBwcm9jZWVkLg0KPiANCj4gQ2Fu
IHlvdSBjbGFyaWZ5IHdoYXQgc2hvdWxkIGJlIGhhcHBlbmluZyBoZXJlIChvciBtYXliZSBzb21l
dGhpbmcNCj4gZWxzZQ0KPiBlbnRpcmVseSk/DQo+IA0KDQpEb2VzIHRoZSBwYXRjaCBJIGp1c3Qg
c2VudCB5b3UgZml4IHRoZSByZWdyZXNzaW9uPw0KDQpDaGVlcnMsDQogIFRyb25kDQoNCi0tIA0K
VHJvbmQgTXlrbGVidXN0DQpMaW51eCBORlMgY2xpZW50IG1haW50YWluZXIsIFByaW1hcnlEYXRh
DQp0cm9uZC5teWtsZWJ1c3RAcHJpbWFyeWRhdGEuY29tDQo=


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: regression from commit 24408f5282
  2017-01-26 20:58 ` regression from commit 24408f5282 Trond Myklebust
@ 2017-01-26 21:20   ` Olga Kornievskaia
  0 siblings, 0 replies; 4+ messages in thread
From: Olga Kornievskaia @ 2017-01-26 21:20 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs

On Thu, Jan 26, 2017 at 3:58 PM, Trond Myklebust
<trondmy@primarydata.com> wrote:
> On Thu, 2017-01-26 at 15:01 -0500, Olga Kornievskaia wrote:
>> Hi Trond,
>>
>> There is regression in the upstream code, it leaves dangling DS
>> mounts. Problem didn't exist in 4.9 and appeared in 4.10.
>>
>> Simple test is : mount, echo 1 > /mnt/foobar, unmount /mnt. Watch the
>> DS mount keep going.
>>
>> The last commit at which the code works is: fe1cf9469d7 "pNFS: Clear
>> all layout segment state in pnfs_mark_layout_stateaid_invalid".
>>
>> Applying commit 24408f5282 "pNFS: Fix bugs in _pnfs_return_layout"
>> introduces the problem.
>>
>> From what I can tell the code is either missing setting
>> NFS_LAYOUT_RETURN_REQUESTED somewhere but I'm not sure.
>>
>> Or if the intent was to just never return the layout even on the
>> unmount, then we need to drop the ref count on the layout here so
>> that
>> unmount can proceed.
>>
>> Can you clarify what should be happening here (or maybe something
>> else
>> entirely)?
>>
>
> Does the patch I just sent you fix the regression?

Yes! that fixes the problem. Thank you.

>
> Cheers,
>   Trond
>
> --
> Trond Myklebust
> Linux NFS client maintainer, PrimaryData
> trond.myklebust@primarydata.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-26 21:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-26 20:01 regression from commit 24408f5282 Olga Kornievskaia
2017-01-26 20:57 ` [PATCH] pNFS: Fix a reference leak in _pnfs_return_layout Trond Myklebust
2017-01-26 20:58 ` regression from commit 24408f5282 Trond Myklebust
2017-01-26 21:20   ` Olga Kornievskaia

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.