From: "Lukáš Czerner" <lczerner@redhat.com>
To: Dave Chinner <david@fromorbit.com>
Cc: Lukas Czerner <lczerner@redhat.com>, xfs@oss.sgi.com
Subject: Re: [PATCH v2] xfs: avoid underflow in xfs_ioc_trim()
Date: Fri, 12 Oct 2012 07:35:39 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.00.1210120727170.6401@localhost> (raw)
In-Reply-To: <20121011213533.GE2739@dastard>
On Fri, 12 Oct 2012, Dave Chinner wrote:
> Date: Fri, 12 Oct 2012 08:35:33 +1100
> From: Dave Chinner <david@fromorbit.com>
> To: Lukas Czerner <lczerner@redhat.com>
> Cc: xfs@oss.sgi.com
> Subject: Re: [PATCH v2] xfs: avoid underflow in xfs_ioc_trim()
>
> On Thu, Oct 11, 2012 at 10:33:52AM +0200, Lukas Czerner wrote:
> > Currently if len argument in xfs_ioc_trim() is smaller than one FSB
> > the 'end' variable underflow. Avoid that by returning EINVAL when
> > range is smaller than FSB.
> >
> > Signed-off-by: Lukas Czerner <lczerner@redhat.com>
>
> Just a thought - wouldn't this be better done at the VFS so it is
> consistent across all filesystems? i.e. using inode->i_blkbits?
>
> Cheers,
>
> Dave.
Currently I am working on patches for other file system, so we'll
get it fix. Having the check in VFS would require to make FITRIM
file system (inode?) operation, or adding cmd specific sections to
the vfs_ioctl(). All of this just for one check and file system
implementation would have to do other check anyway because we can
hardly do all of that in VFS. So I think it's not worth it.
Thanks!
-Lukas
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-10-12 5:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-11 8:33 [PATCH v2] xfs: avoid underflow in xfs_ioc_trim() Lukas Czerner
2012-10-11 21:35 ` Dave Chinner
2012-10-12 5:35 ` Lukáš Czerner [this message]
2012-10-12 5:49 ` Dave Chinner
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=alpine.LFD.2.00.1210120727170.6401@localhost \
--to=lczerner@redhat.com \
--cc=david@fromorbit.com \
--cc=xfs@oss.sgi.com \
/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