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]
Message-Id: <1285751337.18417.61.camel@haakon2.linux-iscsi.org>
Date:	Wed, 29 Sep 2010 02:08:57 -0700
From:	"Nicholas A. Bellinger" <nab@...ux-iscsi.org>
To:	Boaz Harrosh <bharrosh@...asas.com>
Cc:	linux-scsi <linux-scsi@...r.kernel.org>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	Christoph Hellwig <hch@....de>,
	"Martin K. Petersen" <martin.petersen@...cle.com>,
	Douglas Gilbert <dgilbert@...erlog.com>,
	Jens Axboe <axboe@...nel.dk>,
	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>,
	Mike Christie <michaelc@...wisc.edu>,
	Hannes Reinecke <hare@...e.de>,
	James Bottomley <James.Bottomley@...e.de>,
	Konrad Rzeszutek Wilk <konrad@...nok.org>,
	Richard Sharpe <realrichardsharpe@...il.com>
Subject: Re: [PATCH 3/3] tcm/fileio: Add UNMAP / Block DISCARD support

On Wed, 2010-09-29 at 10:57 +0200, Boaz Harrosh wrote:
> On 09/29/2010 10:08 AM, Nicholas A. Bellinger wrote:
> > On Tue, 2010-09-28 at 08:46 +0200, Boaz Harrosh wrote:
> >>> +			printk(KERN_WARNING "Ignoring UNMAP for non BD"
> >>> +					" backend for struct file\n");
> >>
> >> TODO: Lots of extent based filesystems could enjoy if you punch an hole
> >>       in the file. (Which will also send a proper discard).
> >>       So how to punch an hole in a file via vfs?
> > 
> > Good question, as all of the current block discard support assumes a
> > struct block_device * pointer currently.
> > 
> > I know that hch has mentioned that accesing a struct block_device from
> > struct file is very dangerous, but I am assuming for the TCM/FILEIO case
> > that this code will be protected by igrab() and iput().
> > 
> > hch and jaxboe, any comments here..?
> > 
> 
> No you did not understand. FILEIO (working on a filesystem's real file),
> should *never* attempt a discard on the blocks even if it was
> to read the file's map and figure out these blocks. It should always
> call a filesystem specific API that puntches-an-hole in the file.

Mmmm, then I will have to defer to the FS folks on this particular item
then.

> Fore stupid filesystem that means fill with zero's. For a smart
> extent-based file system it means splitting up the extents the range
> belongs to and freeing up the block that where allocated for that
> range. But it is an heavy meta-data operation that only the filesystem
> can do. With really smart FS like xfs the unallocated blocks also
> get discarded, for when working with SANs with over provisioning.
> 

Ok, that makes sense.. But I guess I am still lost on how this could
actually be done for the !(S_ISBLK) struct file case..?

Best,

--nab


--
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