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] [day] [month] [year] [list]
Date:	Thu, 19 Sep 2013 16:22:38 +0200
From:	Jan Kara <jack@...e.cz>
To:	Mel Gorman <mgorman@...e.de>
Cc:	"Darrick J. Wong" <darrick.wong@...cle.com>,
	Kent Overstreet <koverstreet@...gle.com>,
	Jens Axboe <axboe@...nel.dk>, Jan Kara <jack@...e.cz>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: Did immutable bvecs accidentally break stable page writes?

On Thu 19-09-13 10:40:30, Mel Gorman wrote:
> On Thu, Sep 19, 2013 at 10:32:50AM +0100, Mel Gorman wrote:
> > Commit ffecfd1a (block: optionally snapshot page contents to provide
> > stable pages during write) uses bounce buffers for stable page writes in
> > jbd and ext3. Simplistically, __blk_queue_bounce takes a force parameter
> > that is used when pages must be snapshot.
> > 
> > Commit 6bc454d1 (bounce: Refactor __blk_queue_bounce to not use
> > bi_io_vec) refactored __blk_queue_bounce and now the start of the
> > function looks like this
> > 
> > static void __blk_queue_bounce(struct request_queue *q, struct bio **bio_orig,
> > 			       mempool_t *pool, int force)
> > {
> > 	struct bio *bio;
> > 	int rw = bio_data_dir(*bio_orig);
> > 	struct bio_vec *to, *from;
> > 	unsigned i;
> > 
> > 	bio_for_each_segment(from, *bio_orig, i)
> > 		if (page_to_pfn(from->bv_page) > queue_bounce_pfn(q))
> > 			goto bounce;
> > 
> > 	return;
> > bounce:
> > 	bio = bio_clone_bioset(*bio_orig, GFP_NOIO, fs_bio_set);
> > 
> > 	bio_for_each_segment_all(to, bio, i) {
> > 		struct page *page = to->bv_page;
> > 
> > 		if (page_to_pfn(page) <= queue_bounce_pfn(q) && !force)
> > 			continue;
> > 
> > Note that the first bio_for_each_segment is completely ignoring the
> > force parameter and hence snapshotting. This is particularly problematic
> > for ext3 which forces the use of MS_SNAP_STABLE.
> > 
> 
> Which of course is no longer a problem for ext3 after commit 71368511
> ("mm: make snapshotting pages for stable writes a per-bio operation). The
> folly of looking at a commit in isolation! I'm still curious why the force
> parameter is ignored when stable writes are required though.
  This really looks like a bug to me. Since stable pages are currently
required only for drives supporting DIF/DIX noone has likely noticed. But
still we should fix that.

								Honza

PS: As an unrelated note first 8 digits of the commit SHA are not unique
for that commit. Time to switch to longer prefixes? :)
-- 
Jan Kara <jack@...e.cz>
SUSE Labs, CR
--
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