public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] xfs: a few fixes and cleanups to GETFSMAP
@ 2020-10-05 18:21 Darrick J. Wong
  2020-10-05 18:21 ` [PATCH 1/2] xfs: limit entries returned when counting fsmap records Darrick J. Wong
  2020-10-05 18:21 ` [PATCH 2/2] xfs: fix deadlock and streamline xfs_getfsmap performance Darrick J. Wong
  0 siblings, 2 replies; 5+ messages in thread
From: Darrick J. Wong @ 2020-10-05 18:21 UTC (permalink / raw)
  To: darrick.wong
  Cc: Christoph Hellwig, Chandan Babu R, linux-xfs, hch, chandanrlinux

Hi all,

This quick series cleans up a few warts in the XFS GETFSMAP ioctl
implementation.  The first patch prevents an integer overflow when
counting the mappings.  The second patch improves performance of the
ioctl by formatting reverse mappings to an in-kernel buffer and then
copying the entire buffer to userspace (instead of copying the records
one by one).  That eliminates an indirect call and a lot of overhead
from copying things to userspace, which is a bit expensive.  It also
fixes a deadlock when formatting rt fsmappings into a mmap region
backed by sparse file on the rt device.

v2: constrain the in-kernel memory buffer size

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=getfsmap-cleanups-5.10
---
 fs/xfs/xfs_fsmap.c |   48 ++++++++++-------
 fs/xfs/xfs_fsmap.h |    6 --
 fs/xfs/xfs_ioctl.c |  146 +++++++++++++++++++++++++++++++++++-----------------
 3 files changed, 128 insertions(+), 72 deletions(-)


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

end of thread, other threads:[~2020-10-07  8:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-05 18:21 [PATCH v2 0/2] xfs: a few fixes and cleanups to GETFSMAP Darrick J. Wong
2020-10-05 18:21 ` [PATCH 1/2] xfs: limit entries returned when counting fsmap records Darrick J. Wong
2020-10-05 18:21 ` [PATCH 2/2] xfs: fix deadlock and streamline xfs_getfsmap performance Darrick J. Wong
2020-10-06  6:26   ` Christoph Hellwig
2020-10-07  8:40   ` Chandan Babu R

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox