From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com ([192.55.52.120]:8970 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932124AbeAUCLS (ORCPT ); Sat, 20 Jan 2018 21:11:18 -0500 From: Andi Kleen To: Goldwyn Rodrigues Cc: linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, darrick.wong@oracle.com, Goldwyn Rodrigues Subject: Re: [PATCH v5 1/2] Return bytes transferred for partial direct I/O References: <20180119005741.32058-1-rgoldwyn@suse.de> Date: Sat, 20 Jan 2018 18:11:08 -0800 In-Reply-To: <20180119005741.32058-1-rgoldwyn@suse.de> (Goldwyn Rodrigues's message of "Thu, 18 Jan 2018 18:57:40 -0600") Message-ID: <87zi58rmf7.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Goldwyn Rodrigues writes: > From: Goldwyn Rodrigues > > In case direct I/O encounters an error midway, it returns the error. > Instead it should be returning the number of bytes transferred so far. It's likely there's a lot of code in user space that does if (write(..., N) < 0) handle error With your change it would need to be if (write(..., N) != N) handle error How much code is actually doing that? I can understand it fixes your artifical test suite, but it seems to me your change has a high potential to break a lot of existing user code in subtle ways. So it seems to be a bad idea. -Andi