Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751406AbdI3Sb1 (ORCPT ); Sat, 30 Sep 2017 14:31:27 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:33694 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751099AbdI3Sb0 (ORCPT ); Sat, 30 Sep 2017 14:31:26 -0400 Date: Sat, 30 Sep 2017 19:31:24 +0100 From: Al Viro To: Stefan =?iso-8859-1?Q?M=E4tje?= Cc: "linux-kernel@vger.kernel.org" Subject: Re: Change of set_fs() in uaccess.h breaks this header being self contained for x86 (4.14-rc1) Message-ID: <20170930183124.GF21978@ZenIV.linux.org.uk> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.0 (2017-09-02) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1314 Lines: 31 On Mon, Sep 18, 2017 at 08:32:19PM +0200, Stefan Mätje wrote: > Hi, > > there is a change in Linus' mainline kernel > (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/include/asm/uaccess.h?id=6c51e67b64d169419fb13318035bb442f9176612) > that changes the set_fs() macro into an inline function. > > This breaks the build of an out of kernel driver I maintain with this > message: > > ./arch/x86/include/asm/uaccess.h: In function ‘set_fs’: > ./arch/x86/include/asm/uaccess.h:31:9: error: dereferencing pointer to > incomplete type > > set_fs() is referencing the "current" pointer which is of type "struct > task_struct" declared in include/linux/sched.h. > > Before the change set_fs() was a macro. Because I don't use it it was of > no concern for me. But now the compiler needs to compile the inline > function set_fs() and fails. > > Should I add the needed myself in my code or will that > be changed / fixed in the header by including the > missing header. Use linux/uaccess.h. That's the only file that has any business pulling asm/uaccess.h. Again, any code that includes asm/uaccess.h directly is wrong and will be hurt more and more as the time goes and more and more things get moved from arch-dependent into generic parts.