[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1375046132.2546.30.camel@deadeye.wl.decadent.org.uk>
Date: Sun, 28 Jul 2013 22:15:32 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: Theodore Ts'o <tytso@....edu>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [ 71/79] ext4: fix error handling in ext4_ext_truncate()
On Sun, 2013-07-28 at 07:40 -0400, Theodore Ts'o wrote:
> On Sat, Jul 27, 2013 at 10:33:31PM +0100, Ben Hutchings wrote:
> > > --- a/fs/ext4/extents.c
> > > +++ b/fs/ext4/extents.c
> > > @@ -4386,9 +4386,20 @@ void ext4_ext_truncate(handle_t *handle,
> > >
> > > last_block = (inode->i_size + sb->s_blocksize - 1)
> > > >> EXT4_BLOCK_SIZE_BITS(sb);
> > > +retry:
> > > err = ext4_es_remove_extent(inode, last_block,
> > > EXT_MAX_BLOCKS - last_block);
> > > + if (err == ENOMEM) {
> >
> > Positive ENOMEM?! It looks like this value is bubbled up from
> > __es_insert_extent() which returns the usual negative error codes.
>
> Nice catch. Yup, that's a problem. I'll fix this upstream and mark
> it cc:stable.
>
> Until this goes upstream stable kernel maintainers can either: (a) fix
> up this patch by making the line read "err == -ENOMEM", (b) hold back
> this patch until the companion patch to fix this goes upstream, or (c)
> apply this now, since it's otherwise harmless and it does add error
> checking to the ext4_ext_remove_space() call.
We do need that second fix upstream first. I agree that this seems to
fix a bug and doesn't make the ENOMEM case worse. If this is applicable
to 3.2.y (I think it isn't but haven't checked yet) then I'll go with
(c).
Ben.
--
Ben Hutchings
All extremists should be taken out and shot.
Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)
Powered by blists - more mailing lists