From: Dave Chinner <david@fromorbit.com>
To: "Lukáš Czerner" <lczerner@redhat.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH v2] xfs: avoid underflow in xfs_ioc_trim()
Date: Fri, 12 Oct 2012 16:49:27 +1100 [thread overview]
Message-ID: <20121012054927.GM2739@dastard> (raw)
In-Reply-To: <alpine.LFD.2.00.1210120727170.6401@localhost>
On Fri, Oct 12, 2012 at 07:35:39AM +0200, Lukáš Czerner wrote:
> 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
Not at all - filp->mapping->host gets you the inode....
>
> , or adding cmd specific sections to
> the vfs_ioctl().
But that's a fair reason not to....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
prev parent reply other threads:[~2012-10-12 5:48 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
2012-10-12 5:49 ` Dave Chinner [this message]
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=20121012054927.GM2739@dastard \
--to=david@fromorbit.com \
--cc=lczerner@redhat.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