lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 9 Nov 2011 05:34:15 -0500
From:	Christoph Hellwig <hch@...radead.org>
To:	Jan Schmidt <list.btrfs@...-o-sch.net>
Cc:	linux-btrfs <linux-btrfs@...r.kernel.org>,
	Christoph Hellwig <hch@...radead.org>,
	Chris Mason <chris.mason@...cle.com>,
	Arne Jansen <sensille@....net>,
	Andrea Gelmini <andrea.gelmini@...il.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [GIT PULL] Btrfs pull request

On Wed, Nov 09, 2011 at 11:29:31AM +0100, Jan Schmidt wrote:
> Am 09.11.2011 08:48, schrieb Christoph Hellwig:
> >On Tue, Nov 08, 2011 at 08:07:01PM -0500, Chris Mason wrote:
> >>Looks like bio_add_page() is failing and we're getting the enomem from
> >>there.  LVM is only letting us put one page in each bio.
> >
> >Yes, at the moment all bio based DM targets only allow single page I/O.
> 
> Wait. If I got that correctly, each bio_add_page needs special
> ENOMEM treatment (assuming the target could always be a device
> mapper target), right?

Each bio_add_page caller needs to expect it can't add more than a
page worth of data.  If you look at callers what write large amounts
of data (XFS, mpage code) you'll always see a pattern of:

	bio = bio_alloc();

	while (bytes_left) {
		len = min(bytes_left, PAGE_SIZE);
		bytes = bio_add_page(io, ..., len);
		if (bytes < len) {
			submit_bio(bio);
			bio = bio_alloc();
		}
		update_indices();
	}
	submit_bio(bio);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ