lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <BANLkTinffxSZKjXh2EnTEDLYJa6smLXgmQ@mail.gmail.com> Date: Thu, 30 Jun 2011 10:15:05 +0800 From: Steven Liu <lingjiujianke@...il.com> To: "Theodore Ts'o" <tytso@....edu> Cc: Ext4 Developers List <linux-ext4@...r.kernel.org> Subject: Re: [PATCH] ext4: remove loop around bio_alloc() 2011/6/30 Theodore Ts'o <tytso@....edu>: > These days, bio_alloc() is guaranteed to never fail (as long as nvecs > is less than BIO_MAX_PAGES), so we don't need the loop around the > struct bio allocation. > > Signed-off-by: "Theodore Ts'o" <tytso@....edu> > --- > fs/ext4/page-io.c | 6 +----- > 1 files changed, 1 insertions(+), 5 deletions(-) > > diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c > index 7bb8f76..430c401 100644 > --- a/fs/ext4/page-io.c > +++ b/fs/ext4/page-io.c > @@ -285,11 +285,7 @@ static int io_submit_init(struct ext4_io_submit *io, > io_end = ext4_init_io_end(inode, GFP_NOFS); > if (!io_end) > return -ENOMEM; > - do { > - bio = bio_alloc(GFP_NOIO, nvecs); > - nvecs >>= 1; > - } while (bio == NULL); > - > + bio = bio_alloc(GFP_NOIO, min(nvecs, BIO_MAX_PAGES)); I think , If this do not need to loop around the struct bio allocation insurance, if it check allocation value and give the faild message, maybe better. is it? > bio->bi_sector = bh->b_blocknr * (bh->b_size >> 9); > bio->bi_bdev = bh->b_bdev; > bio->bi_private = io->io_end = io_end; > -- > 1.7.4.1.22.gec8e1.dirty > > -- > To unsubscribe from this list: send the line "unsubscribe linux-ext4" in > the body of a message to majordomo@...r.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists