linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] pnfs-submit fix kfree under spin lock
@ 2010-07-20 17:01 andros
  2010-07-20 17:01 ` [PATCH 1/5] SQUASHME pnfs-submit alloc layout don't call put_layout " andros
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: andros @ 2010-07-20 17:01 UTC (permalink / raw)
  To: bhalevy; +Cc: linux-nfs


Fix kfree under spin lock

Both put_lseg and put_layout are called under the inode i_lock where the
last reference will end up freeing structures.

I know there has been a lot of churn in this code, but free'ing under the
spin lock is a no-no.
In this patch I refactor the layout allocation, combining it with the
layout segment lookup code. The new function, pnfs_get_layout_segment takes
inode spin lock, and looks to see if the requested range is serviced by an
existing layout segment. If the layout has not been allocated, allocate it.
If a layout segement is found, reference it and give up the lock. If no
layout segment is found, reference the layout for the layoutget call and 
give up the lock.

0001-SQUASHME-pnfs-submit-alloc-layout-don-t-call-put_lay.patch
0002-SQUASHME-pnfs-submit-use-atomic_dec_and_lock-for-lay.patch

Fix the put_lseg under spin lock.
0003-SQUASHME-pnfs-submit-don-t-call-put_lseg-under-spin-.patch

Cleanup.
0004-SQUASHME-pnfs-submit-pnfs_release_layout-just-use-in.patch
0005-SQUASHME-pnfs-submit-fix-has_layout-compile-error.patch

Tests:
CONFIG_NFS_V4_1 set:
Connectathon tests pass against GFS2 and pyNFS file layout servers.

CONFIG_NFS_V4_1 not set:
Connectathon tests pass.

-->Andy


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

end of thread, other threads:[~2010-07-22 16:26 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-20 17:01 [PATCH 0/5] pnfs-submit fix kfree under spin lock andros
2010-07-20 17:01 ` [PATCH 1/5] SQUASHME pnfs-submit alloc layout don't call put_layout " andros
2010-07-20 17:01   ` [PATCH 2/5] SQUASHME pnfs-submit use atomic_dec_and_lock for layout refcounting andros
2010-07-20 17:01     ` [PATCH 3/5] SQUASHME pnfs-submit don't call put_lseg under spin lock andros
2010-07-20 17:01       ` [PATCH 4/5] SQUASHME pnfs-submit pnfs_release_layout just use inode andros
2010-07-20 17:01         ` [PATCH 5/5] SQUASHME pnfs-submit fix has_layout compile error andros
2010-07-22 16:26   ` [PATCH 1/5] SQUASHME pnfs-submit alloc layout don't call put_layout under spin lock Benny Halevy
2010-07-20 17:30 ` [PATCH 0/5] pnfs-submit fix kfree " William A. (Andy) Adamson
     [not found]   ` <AANLkTikzt-A69kM863U=YuGZ1-HGWr51KsJEts3uKFx6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-21  7:23     ` Benny Halevy
2010-07-21 14:46       ` William A. (Andy) Adamson
2010-07-20 19:09 ` Christoph Hellwig
2010-07-20 20:36   ` William A. (Andy) Adamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).