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
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 25 Mar 2015 16:27:48 +0100
From:	Christoph Hellwig <hch@....de>
To:	Ming Lei <ming.lei@...onical.com>
Cc:	Christoph Hellwig <hch@....de>, Jens Axboe <axboe@...com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Al Viro <viro@...iv.linux.org.uk>,
	Maxim Patlasov <mpatlasov@...allels.com>
Subject: Re: [PATCH 0/3] block: loop: switch to VFS ITER_BVEC

On Wed, Mar 25, 2015 at 03:23:48PM +0800, Ming Lei wrote:
> > -       mm_segment_t old_fs = get_fs();
> > +
> > +       iov_iter_bvec(&i, ITER_BVEC, bvec, 1, bvec->bv_len);
> >
> >         file_start_write(file);
> > -       set_fs(get_ds());
> > -       bw = file->f_op->write(file, buf, len, &pos);
> > -       set_fs(old_fs);
> > +       bw = vfs_iter_write(file, &i, ppos);
> 
> This patch moves to support ->read_iter/->write_iter only, which
> might cause regression for backing file without defining read/write
> iter callback.

->read_iter/->write_iter is the main fs I/O path - by the time this is
ready ->aio_read/->aio_write should be gone.

> > +       page = alloc_page(GFP_NOIO);
> > +       if (unlikely(!page))
> > +               return -ENOMEM;
> 
> The above page allocation is one code duplication.

A very trivial one, isn't it? :)

> IMO, lo_read/write_transfer and lo_read/write_simple can be
> merged to avoid code duplication, since the logic for handling
> lo->transfer in read/write is quite simple.

If you have a patch that merges them while making the code smaller and
simpler you're welcome.  I wasn't really good enough to come up with
a way that would be an improvement.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ