From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754611AbcK1Iye convert rfc822-to-8bit (ORCPT ); Mon, 28 Nov 2016 03:54:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45718 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752805AbcK1Iy0 (ORCPT ); Mon, 28 Nov 2016 03:54:26 -0500 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: [git pull] vfs fix From: "Yan, Zheng" In-Reply-To: <20161127025113.GX1555@ZenIV.linux.org.uk> Date: Mon, 28 Nov 2016 16:54:17 +0800 Cc: Linus Torvalds , Linux Kernel Mailing List , linux-fsdevel , Yan@ZenIV.linux.org.uk, Zhu@ZenIV.linux.org.uk, Caifeng Content-Transfer-Encoding: 8BIT Message-Id: <48961E91-ECF5-4EC4-91F2-4FF270133927@redhat.com> References: <20161127011352.GV1555@ZenIV.linux.org.uk> <20161127022506.GW1555@ZenIV.linux.org.uk> <20161127025113.GX1555@ZenIV.linux.org.uk> To: Al Viro X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 28 Nov 2016 08:54:26 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 27 Nov 2016, at 10:51, Al Viro wrote: > > On Sun, Nov 27, 2016 at 02:25:09AM +0000, Al Viro wrote: > >> Anyway, leaving that BUG_ON() had been wrong; I can send a followup >> massaging that thing as you've suggested, if you are interested in >> that. But keep in mind that the whole iov_iter_get_pages...() calling >> conventions are going to be changed, hopefully soon. > > BTW, speaking of iov_iter_get_pages_alloc() callers and splice: > "ceph: combine as many iovec as possile into one OSD request" has added > static size_t dio_get_pagev_size(const struct iov_iter *it) > { > const struct iovec *iov = it->iov; > const struct iovec *iovend = iov + it->nr_segs; > size_t size; > > size = iov->iov_len - it->iov_offset; > /* > * An iov can be page vectored when both the current tail > * and the next base are page aligned. > */ > while (PAGE_ALIGNED((iov->iov_base + iov->iov_len)) && > (++iov < iovend && PAGE_ALIGNED((iov->iov_base)))) { > size += iov->iov_len; > } > dout("dio_get_pagevlen len = %zu\n", size); > return size; > } The read/write interface for ceph cluster accepts page vector. But we can only specify offset for the first page. Except the first and last pages, all other pages must be full size. This function finds size of pages that satisfy this requirement Regards Yan, Zheng > > ... with 'it' possibly being bio_vec-backed iterator. Could somebody > explain what that code is trying to do? > > I would really like to hear details - I'm not saying that the goal mentioned > in the commit message is worthless, but I don't know ceph codebase well > enough to tell what would be a good way to implement that. In its current > form it's obviously broken.