From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753121AbeCPIq5 (ORCPT ); Fri, 16 Mar 2018 04:46:57 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:52108 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751424AbeCPIqz (ORCPT ); Fri, 16 Mar 2018 04:46:55 -0400 Date: Fri, 16 Mar 2018 01:46:53 -0700 From: Christoph Hellwig To: Arnd Bergmann Cc: Dominik Brodowski , Linux Kernel Mailing List , Linus Torvalds , Al Viro , Andy Lutomirski , Ingo Molnar , Andrew Morton Subject: Re: [PATCH v2 14/36] fs: add ksys_mount() helper; remove in-kernel calls to sys_mount() Message-ID: <20180316084653.GC4151@infradead.org> References: <20180315190529.20943-1-linux@dominikbrodowski.net> <20180315190529.20943-15-linux@dominikbrodowski.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 15, 2018 at 09:11:27PM +0100, Arnd Bergmann wrote: > Shouldn't the callers of sys_mount just call do_mount() instead? > > As I understand it, sys_mount is already a wrapper around do_mount() > that copies its arguments from user space, but we don't need that > when called from inside the kernel. In general yes. do_mount.c has some really strange calling context where it tries to operate on kernel and user pointers interchangably, but even with that just switching to do_mount seems like the right thing to me. In fact once we do that and take care or chdir/chdoot we could probably get rid of the sparse disable hack in favour of a few __force casts in change_floppy and sort this mess out as well.