Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1262988

Re: [PATCH] brd: Refuse improperly aligned discard requests

From Jan Kara <jack@suse.cz>
Newsgroups linux.kernel
Subject Re: [PATCH] brd: Refuse improperly aligned discard requests
Date 2015-11-05 09:10 +0100
Message-ID <qrnMm-3ZY-13@gated-at.bofh.it> (permalink)
References <qr8WZ-2KK-9@gated-at.bofh.it> <qrkls-1IA-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu 05-11-15 04:18:49, Elliott, Robert (Persistent Memory) wrote:
> 
> > -----Original Message-----
> > From: linux-kernel-owner@vger.kernel.org [mailto:linux-kernel-
> > owner@vger.kernel.org] On Behalf Of Jan Kara
> > Sent: Wednesday, November 4, 2015 10:14 AM
> > To: axboe@kernel.dk
> > Cc: LKML <linux-kernel@vger.kernel.org>; linux-fsdevel@vger.kernel.org;
> > Christoph Hellwig <hch@infradead.org>; Jan Kara <jack@suse.com>
> > Subject: [PATCH] brd: Refuse improperly aligned discard requests
> > 
> > Currently when improperly aligned discard request is submitted, we just
> > silently discard more / less data which results in filesystem corruption
> > in some cases. Refuse such misaligned requests.
> 
> I agree discarding more than requested is very bad.
> 
> If they are routed to SCSI or ATA devices, though, the discard commands
> (SCSI UNMAP or ATA DATA SET MANAGEMENT/TRIM) are just hints, so there 
> is no guarantee the discard will do anything.  Are you finding 
> filesystems that still don't understand that?   dm-raid held that
> mistaken assumption for a long time.

So there is blkdev_issue_zeroout() which uses blkdev_issue_discard() if
'discard_zeroes_data' is set. I'd hope that in that case zeroing really
happens as submitted or error is returned... Filesystems definitely depend
on blkdev_issue_zeroout() doing what it is told.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] brd: Refuse improperly aligned discard requests Jan Kara <jack@suse.com> - 2015-11-04 17:20 +0100
  RE: [PATCH] brd: Refuse improperly aligned discard requests "Elliott, Robert (Persistent Memory)" <elliott@hpe.com> - 2015-11-05 05:30 +0100
    Re: [PATCH] brd: Refuse improperly aligned discard requests Jan Kara <jack@suse.cz> - 2015-11-05 09:10 +0100
  Re: [PATCH] brd: Refuse improperly aligned discard requests Jens Axboe <axboe@kernel.dk> - 2015-11-05 21:20 +0100

csiph-web