From: Jan Kara <jack@suse.cz>
To: "Elliott, Robert (Persistent Memory)" <elliott@hpe.com>
Cc: Jan Kara <jack@suse.com>, "axboe@kernel.dk" <axboe@kernel.dk>,
LKML <linux-kernel@vger.kernel.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH] brd: Refuse improperly aligned discard requests
Date: Thu, 5 Nov 2015 09:06:42 +0100 [thread overview]
Message-ID: <20151105080642.GD20212@quack.suse.cz> (raw)
In-Reply-To: <94D0CD8314A33A4D9D801C0FE68B40295BE0AFAA@G4W3202.americas.hpqcorp.net>
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
next prev parent reply other threads:[~2015-11-05 8:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-04 16:13 [PATCH] brd: Refuse improperly aligned discard requests Jan Kara
2015-11-05 4:18 ` Elliott, Robert (Persistent Memory)
2015-11-05 8:06 ` Jan Kara [this message]
2015-11-05 20:11 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151105080642.GD20212@quack.suse.cz \
--to=jack@suse.cz \
--cc=axboe@kernel.dk \
--cc=elliott@hpe.com \
--cc=hch@infradead.org \
--cc=jack@suse.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).