From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1glqwL-00015m-3b for barebox@lists.infradead.org; Tue, 22 Jan 2019 07:57:46 +0000 Date: Tue, 22 Jan 2019 08:57:42 +0100 From: Sascha Hauer Message-ID: <20190122075742.xbf4brm2465c4yvv@pengutronix.de> References: <20190122060625.12337-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190122060625.12337-1-andrew.smirnov@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH 1/2] block: Do not write past block device boundary during a flush To: Andrey Smirnov Cc: barebox@lists.infradead.org On Mon, Jan 21, 2019 at 10:06:24PM -0800, Andrey Smirnov wrote: > When calling I/O functions of underlying block device driver we always > need to make sure that its size is small enough to not go past > device's boundary. Not only in get_chunk() and block_cache(), but in > writebuffer_flush() as well. Since the same code is used in three > different places, move it into a subroutine and adjust all of the > calls to ->write()/->read() accordingly. > > Signed-off-by: Andrey Smirnov > --- > common/block.c | 22 +++++++++++++--------- > 1 file changed, 13 insertions(+), 9 deletions(-) Applied, thanks Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox