From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH 3/5] fs: remove ki_nbytes Date: Thu, 5 Feb 2015 08:47:29 +0000 Message-ID: <20150205084729.GO29656@ZenIV.linux.org.uk> References: <20150204190645.GJ29656@ZenIV.linux.org.uk> <20150204230733.GK29656@ZenIV.linux.org.uk> <54D328C0.1070400@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Alan Stern , Christoph Hellwig , Miklos Szeredi , linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, Felipe Balbi , linux-usb@vger.kernel.org To: Robert Baldyga Return-path: Content-Disposition: inline In-Reply-To: <54D328C0.1070400@samsung.com> Sender: owner-linux-aio@kvack.org List-Id: linux-fsdevel.vger.kernel.org On Thu, Feb 05, 2015 at 09:24:32AM +0100, Robert Baldyga wrote: > No, function/f_fs.c and legacy/inode.c are in class (1). They have > datagram semantics - each vector element is submitted in separate USB > request. Each single request is sent in separate USB data packet (for > bulk endpoints it can be more than one packet). In fact sync > read()/write() also will give different results while called once with > some block of data or in loop with the same block of data splitted into > a few parts. No, they don't. This is from ffs_epfile_io(): data = kmalloc(data_len, GFP_KERNEL); if (unlikely(!data)) return -ENOMEM; if (io_data->aio && !io_data->read) { int i; size_t pos = 0; for (i = 0; i < io_data->nr_segs; i++) { if (unlikely(copy_from_user(&data[pos], io_data->iovec[i].iov_base, io_data->iovec[i].iov_len))) { ret = -EFAULT; goto error; } pos += io_data->iovec[i].iov_len; } and that's the last point where it looks at iovec. After that all work is done to the copy in data, where no information about the boundaries survives. And ep_aio_write() (in legacy/inode.c) is the same way. You are confusing datagram-per-syscall (which they are) with datagram-per-iovec (which they are definitely not). IOW, they behave as UDP sockets - writev() is purely scatter-gather variant of write(), with datagram per syscall and all vector elements silently concatenated. That's class 2, and _not_ in its intersection with class 1. -- To unsubscribe, send a message with 'unsubscribe linux-aio' in the body to majordomo@kvack.org. For more info on Linux AIO, see: http://www.kvack.org/aio/ Don't email: aart@kvack.org