Skip to content

pnfs-submit fix kfree under spin lock

[email protected] linux-nfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5SQUASHME pnfs-submit alloc layout don't call put_layout under spin lockfs/nfs/pnfs.c+43 -741 reply
2/5SQUASHME pnfs-submit use atomic_dec_and_lock for layout refcountingfs/nfs/pnfs.c include/linux/nfs_fs.h+30 -410 replies
3/5SQUASHME pnfs-submit don't call put_lseg under spin lockfs/nfs/pnfs.c fs/nfs/pnfs.h include/linux/nfs4_pnfs.h+40 -530 replies
4/5SQUASHME pnfs-submit pnfs_release_layout just use inodefs/nfs/nfs4proc.c fs/nfs/pnfs.c fs/nfs/pnfs.h+11 -120 replies
5/5SQUASHME pnfs-submit fix has_layout compile errorinclude/linux/nfs4_pnfs.h+6 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] pnfs-submit fix kfree under spin lock

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