From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751562AbdALL5t (ORCPT ); Thu, 12 Jan 2017 06:57:49 -0500 Received: from mail-qk0-f177.google.com ([209.85.220.177]:35471 "EHLO mail-qk0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751206AbdALL5r (ORCPT ); Thu, 12 Jan 2017 06:57:47 -0500 Message-ID: <1484222263.2970.23.camel@redhat.com> Subject: Re: [PATCH v2] ceph/iov_iter: fix bad iov_iter handling in ceph splice codepaths From: Jeff Layton To: Ilya Dryomov , Al Viro Cc: "Yan, Zheng" , Sage Weil , Ceph Development , linux-fsdevel , "linux-kernel@vger.kernel.org" , "Zhu, Caifeng" Date: Thu, 12 Jan 2017 06:57:43 -0500 In-Reply-To: References: <1483727016-343-1-git-send-email-jlayton@redhat.com> <1484053051-23685-1-git-send-email-jlayton@redhat.com> <20170112075946.GU1555@ZenIV.linux.org.uk> <20170112113743.GX1555@ZenIV.linux.org.uk> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2017-01-12 at 12:46 +0100, Ilya Dryomov wrote: > On Thu, Jan 12, 2017 at 12:37 PM, Al Viro wrote: > > > > On Thu, Jan 12, 2017 at 12:13:31PM +0100, Ilya Dryomov wrote: > > > > > > > > It would be a significant and wide-reaching change, but I've been > > > meaning to look into switching to iov_iter for a couple of releases > > > now. There is a lot of ugly code in net/ceph/messenger.c to hangle > > > iteration over "page vectors", "page lists" and "bio lists". All of it > > > predates iov_iter proliferation and is mostly incomplete anyway: IIRC > > > you can send out of a pagelist but can't recv into a pagelist, etc. > > > > Wait a sec... Is it done from the same thread that has issued a syscall? > > If so, we certainly could just pass iov_iter without bothering with any > > form of ..._get_pages(); if not, we'll need at least to get from iovec > > to bio_vec, since userland addresses make sense only in the caller's > > context... > > No, not necessarily - it's also used by rbd (all of net/ceph has two > users: fs/ceph and drivers/block/rbd.c). > > ...and note that the actual send/receive is done from workqueue context (AFAICT), so we might be operating over the array from a completely different thread context from where it was submitted. I think we do need to get page references at the point of submission like this. -- Jeff Layton