All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 3/3] btrfs: increase output size for LOGICAL_INO_V2 ioctl
Date: Fri, 22 Sep 2017 13:58:47 -0400	[thread overview]
Message-ID: <20170922175847.6071-4-ce3g8jdj@umail.furryterror.org> (raw)
In-Reply-To: <20170922175847.6071-1-ce3g8jdj@umail.furryterror.org>

Build-server workloads have hundreds of references per file after dedup.
Multiply by a few snapshots and we quickly exhaust the limit of 2730
references per extent that can fit into a 64K buffer.

Raise the limit to 16M to be consistent with other btrfs ioctls
(e.g. TREE_SEARCH_V2, FILE_EXTENT_SAME).

To minimize surprising userspace behavior, apply this change only to
the LOGICAL_INO_V2 ioctl.

Signed-off-by: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
---
 fs/btrfs/ioctl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index f4281ffd1833..1940678fc440 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -4554,6 +4554,7 @@ static long btrfs_ioctl_logical_to_ino(struct btrfs_fs_info *fs_info,
 
 	if (version == 1) {
 		ignore_offset = false;
+		size = min_t(u32, loi->size, SZ_64K);
 	} else {
 		/* All reserved bits must be 0 for now */
 		if (memchr_inv(loi->reserved, 0, sizeof(loi->reserved))) {
@@ -4566,6 +4567,7 @@ static long btrfs_ioctl_logical_to_ino(struct btrfs_fs_info *fs_info,
 			goto out_loi;
 		}
 		ignore_offset = loi->flags & BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET;
+		size = min_t(u32, loi->size, SZ_16M);
 	}
 
 	path = btrfs_alloc_path();
@@ -4574,7 +4576,6 @@ static long btrfs_ioctl_logical_to_ino(struct btrfs_fs_info *fs_info,
 		goto out;
 	}
 
-	size = min_t(u32, loi->size, SZ_64K);
 	inodes = init_data_container(size);
 	if (IS_ERR(inodes)) {
 		ret = PTR_ERR(inodes);
-- 
2.11.0


  parent reply	other threads:[~2017-09-22 17:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-22 17:58 [PATCH v3] btrfs: LOGICAL_INO enhancements Zygo Blaxell
2017-09-22 17:58 ` [PATCH 1/3] btrfs: add a flag to iterate_inodes_from_logical to find all extent refs for uncompressed extents Zygo Blaxell
2017-10-19 17:03   ` David Sterba
2017-09-22 17:58 ` [PATCH 2/3] btrfs: add a flags argument to LOGICAL_INO and call it LOGICAL_INO_V2 Zygo Blaxell
2017-09-23 20:38   ` Hans van Kranenburg
2017-09-22 17:58 ` Zygo Blaxell [this message]
2017-09-23 21:06   ` [PATCH 3/3] btrfs: increase output size for LOGICAL_INO_V2 ioctl Hans van Kranenburg
2017-10-19 17:07     ` David Sterba
2019-08-30  7:55 ` Fwd: [PATCH v3] btrfs: LOGICAL_INO enhancements Anand Jain
  -- strict thread matches above, loose matches on Subject: below --
2017-09-21  4:10 [PATCH v2] btrfs: LOGICAL_INO enhancements (this time based on 4.14-rc1) Zygo Blaxell
2017-09-21  4:10 ` [PATCH 3/3] btrfs: increase output size for LOGICAL_INO_V2 ioctl Zygo Blaxell
2017-09-21  0:33 [PATCH 1/3] btrfs: add a flag to iterate_inodes_from_logical to find all extent refs for uncompressed extents Zygo Blaxell
2017-09-21  0:33 ` [PATCH 3/3] btrfs: increase output size for LOGICAL_INO_V2 ioctl Zygo Blaxell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170922175847.6071-4-ce3g8jdj@umail.furryterror.org \
    --to=ce3g8jdj@umail.furryterror.org \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.