From owner-svn-src-all@freebsd.org Sat Feb 25 20:32:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2CF7CEDFC0; Sat, 25 Feb 2017 20:32:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4C49F06; Sat, 25 Feb 2017 20:32:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1PKWbD0026496; Sat, 25 Feb 2017 20:32:37 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1PKWbXK026493; Sat, 25 Feb 2017 20:32:37 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201702252032.v1PKWbXK026493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 25 Feb 2017 20:32:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r314282 - in head/sys: amd64/linux32 compat/linux i386/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Feb 2017 20:32:39 -0000 Author: trasz Date: Sat Feb 25 20:32:37 2017 New Revision: 314282 URL: https://svnweb.freebsd.org/changeset/base/314282 Log: Fix linux_fstatfs() to return proper value for f_frsize. Without it, linux df(1) binary from Xenial shows garbage. Reviewed by: dchagin MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9692 Modified: head/sys/amd64/linux32/linux.h head/sys/compat/linux/linux_stats.c head/sys/i386/linux/linux.h Modified: head/sys/amd64/linux32/linux.h ============================================================================== --- head/sys/amd64/linux32/linux.h Sat Feb 25 20:21:39 2017 (r314281) +++ head/sys/amd64/linux32/linux.h Sat Feb 25 20:32:37 2017 (r314282) @@ -250,7 +250,9 @@ struct l_statfs64 { uint64_t f_ffree; l_fsid_t f_fsid; l_int f_namelen; - l_int f_spare[6]; + l_int f_frsize; + l_int f_flags; + l_int f_spare[4]; } __packed; /* sigaction flags */ Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Sat Feb 25 20:21:39 2017 (r314281) +++ head/sys/compat/linux/linux_stats.c Sat Feb 25 20:32:37 2017 (r314282) @@ -303,7 +303,9 @@ struct l_statfs { l_long f_ffree; l_fsid_t f_fsid; l_long f_namelen; - l_long f_spare[6]; + l_long f_frsize; + l_long f_flags; + l_long f_spare[4]; }; #define LINUX_CODA_SUPER_MAGIC 0x73757245L @@ -371,6 +373,9 @@ bsd_to_linux_statfs(struct statfs *bsd_s linux_statfs->f_fsid.val[0] = bsd_statfs->f_fsid.val[0]; linux_statfs->f_fsid.val[1] = bsd_statfs->f_fsid.val[1]; linux_statfs->f_namelen = MAXNAMLEN; + linux_statfs->f_frsize = bsd_statfs->f_bsize; + linux_statfs->f_flags = 0; + memset(linux_statfs->f_spare, 0, sizeof(linux_statfs->f_spare)); return (0); } @@ -415,6 +420,9 @@ bsd_to_linux_statfs64(struct statfs *bsd linux_statfs->f_fsid.val[0] = bsd_statfs->f_fsid.val[0]; linux_statfs->f_fsid.val[1] = bsd_statfs->f_fsid.val[1]; linux_statfs->f_namelen = MAXNAMLEN; + linux_statfs->f_frsize = bsd_statfs->f_bsize; + linux_statfs->f_flags = 0; + memset(linux_statfs->f_spare, 0, sizeof(linux_statfs->f_spare)); } int Modified: head/sys/i386/linux/linux.h ============================================================================== --- head/sys/i386/linux/linux.h Sat Feb 25 20:21:39 2017 (r314281) +++ head/sys/i386/linux/linux.h Sat Feb 25 20:32:37 2017 (r314282) @@ -225,7 +225,9 @@ struct l_statfs64 { uint64_t f_ffree; l_fsid_t f_fsid; l_int f_namelen; - l_int f_spare[6]; + l_int f_frsize; + l_int f_flags; + l_int f_spare[4]; }; #define LINUX_NSIG_WORDS 2