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]
Message-ID: <x49bneiygpl.fsf@segfault.boston.devel.redhat.com>
Date:	Fri, 07 Aug 2015 16:41:10 -0400
From:	Jeff Moyer <jmoyer@...hat.com>
To:	"Wilcox\, Matthew R" <matthew.r.wilcox@...el.com>
Cc:	"linda.knippers\@hp.com" <linda.knippers@...com>,
	"linux-kernel\@vger.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-fsdevel\@vger.kernel.org" <linux-fsdevel@...r.kernel.org>
Subject: Re: regression introduced by "block: Add support for DAX reads/writes to block devices"

"Wilcox, Matthew R" <matthew.r.wilcox@...el.com> writes:

> So ... what you're doing here is if somebody requests the last 512
> bytes, you're asking for the last page.  That's going to work as long
> as the partition is a multiple of PAGE_SIZE, but not if the partition
> happens to be misaligned.  It's an improvement, although I'd be
> tempted to do this as:
>
> 		if (pos == max) {
>  			unsigned blkbits = inode->i_blkbits;
> - 			sector_t block = pos >> blkbits;
> +			long page = pos >> PAGE_SHIFT;
> +			sector_t block = page << (PAGE_SHIFT - blkbits);
> 			unsigned first = pos - (block << blkbits);
> 			long size;

Yeah, that's easier to read.

> We need to cope with the case where the end of a partition isn't on a
> page boundary though.

Well, that's usually done by falling back to buffered I/O.  I gave that
a try and panicked the box.  :)  I'll keep looking into it, but probably
won't have another patch until next week.

Cheers,
Jeff
--
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