From: Christoph Hellwig <hch@infradead.org>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-api@vger.kernel.org, xfs@oss.sgi.com,
Al Viro <viro@ZenIV.linux.org.uk>,
linux-fsdevel@vger.kernel.org,
"Kirill A. Shutemov" <kirill@shutemov.name>,
Vlastimil Babka <vbabka@suse.cz>
Subject: Re: [PATCH] vfs: cap dedupe request structure size at PAGE_SIZE
Date: Sun, 31 Jul 2016 23:31:28 -0700 [thread overview]
Message-ID: <20160801063128.GA15590@infradead.org> (raw)
In-Reply-To: <20160728183534.GB15753@birch.djwong.org>
On Thu, Jul 28, 2016 at 11:35:34AM -0700, Darrick J. Wong wrote:
> Kirill A. Shutemov reports that the kernel doesn't try to cap dest_count
> in any way, and uses the number to allocate kernel memory. This causes
> high order allocation warnings in the kernel log if someone passes in a
> big enough value. We should clamp the allocation at PAGE_SIZE to avoid
> stressing the VM.
>
> The two existing users of the dedupe ioctl never send more than 120
> requests, so we can safely clamp dest_range at PAGE_SIZE, because with
> 4k pages we can handle up to 127 dedupe candidates. Given the max
> extent length of 16MB, we can end up doing 2GB of IO which is plenty.
Looks fine,
Reviewed-by: Christoph Hellwig <hch@lst.de>
> @@ -582,6 +582,10 @@ static int ioctl_file_dedupe_range(struct file *file, void __user *arg)
This function returns long in mainline. Maybe you should resend your
return type fix to Al while you're at it?
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2016-08-01 6:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-28 18:35 [PATCH] vfs: cap dedupe request structure size at PAGE_SIZE Darrick J. Wong
2016-08-01 6:31 ` Christoph Hellwig [this message]
2016-08-02 2:35 ` Mark Fasheh
-- strict thread matches above, loose matches on Subject: below --
2016-09-15 3:20 Darrick J. Wong
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=20160801063128.GA15590@infradead.org \
--to=hch@infradead.org \
--cc=darrick.wong@oracle.com \
--cc=kirill@shutemov.name \
--cc=linux-api@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=vbabka@suse.cz \
--cc=viro@ZenIV.linux.org.uk \
--cc=xfs@oss.sgi.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox