From owner-svn-src-projects@freebsd.org Mon May 20 15:58:45 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B516115B107A for ; Mon, 20 May 2019 15:58:45 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35CDC84620; Mon, 20 May 2019 15:58:45 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2260A206F9; Mon, 20 May 2019 15:58:45 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4KFwj0L003787; Mon, 20 May 2019 15:58:45 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KFwiJU003786; Mon, 20 May 2019 15:58:44 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905201558.x4KFwiJU003786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 20 May 2019 15:58:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r347991 - projects/fuse2/sbin/mount_fusefs X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: projects/fuse2/sbin/mount_fusefs X-SVN-Commit-Revision: 347991 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 35CDC84620 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 15:58:45 -0000 Author: asomers Date: Mon May 20 15:58:44 2019 New Revision: 347991 URL: https://svnweb.freebsd.org/changeset/base/347991 Log: mount_fusefs(8): document the -o subtype option. Sponsored by: The FreeBSD Foundation Modified: projects/fuse2/sbin/mount_fusefs/mount_fusefs.8 Modified: projects/fuse2/sbin/mount_fusefs/mount_fusefs.8 ============================================================================== --- projects/fuse2/sbin/mount_fusefs/mount_fusefs.8 Mon May 20 12:57:39 2019 (r347990) +++ projects/fuse2/sbin/mount_fusefs/mount_fusefs.8 Mon May 20 15:58:44 2019 (r347991) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 17, 2018 +.Dd May 19, 2019 .Dt MOUNT_FUSEFS 8 .Os .Sh NAME @@ -153,6 +153,13 @@ This is the default behaviour, to allow sharing, expic Do not refuse unmounting if there are secondary mounts .It Cm push_symlinks_in Prefix absolute symlinks with the mountpoint +.It Cm subtype Ns = Ns Ar fsname +Suffix +.Ar fsname +to the file system name as reported by +.Xr statfs 2 . +This option can be used to identify the file system implemented by +.Ar fuse_daemon . .El .El .Pp From owner-svn-src-projects@freebsd.org Mon May 20 19:36:37 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 916BA159041E for ; Mon, 20 May 2019 19:36:37 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32AF98F2C0; Mon, 20 May 2019 19:36:37 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D2DF22CA3; Mon, 20 May 2019 19:36:37 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4KJaadb023311; Mon, 20 May 2019 19:36:36 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KJaaIC023310; Mon, 20 May 2019 19:36:36 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905201936.x4KJaaIC023310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 20 May 2019 19:36:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r348007 - projects/fuse2/lib/libc/gen X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: projects/fuse2/lib/libc/gen X-SVN-Commit-Revision: 348007 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 32AF98F2C0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 19:36:37 -0000 Author: asomers Date: Mon May 20 19:36:36 2019 New Revision: 348007 URL: https://svnweb.freebsd.org/changeset/base/348007 Log: special-case getvfsbyname(3) for fusefs(5) fusefs file systems may have a fsname subtype (set by mount_fusefs's "-o subtype" option) that gets appended to the fsname as returned by statfs(2). The subtype is set on a per-mount basis so it isn't part of the struct vfsconf. Special-case getvfsbyname to match either the full "fusefs.foobar" or short "fusefs" fsname. Sponsored by: The FreeBSD Foundation Modified: projects/fuse2/lib/libc/gen/getvfsbyname.c Modified: projects/fuse2/lib/libc/gen/getvfsbyname.c ============================================================================== --- projects/fuse2/lib/libc/gen/getvfsbyname.c Mon May 20 19:31:49 2019 (r348006) +++ projects/fuse2/lib/libc/gen/getvfsbyname.c Mon May 20 19:36:36 2019 (r348007) @@ -37,10 +37,26 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include /* + * fusefs(5) file systems may have a "subtype" which gets appended to + * statfs(2)'s f_fstypename field on a per-mount basis. Allow getvfsbyname to + * match either the full "fusefs.foobar" or the more general "fusefs". + */ +static bool +are_fusefs(const char *fsname, const char *vfc_name) +{ + const char fusefs[] = "fusefs"; + const char fusefs_dot[] = "fusefs."; + + return (strncmp(fsname, fusefs_dot, strlen(fusefs_dot)) == 0 && + strcmp(fusefs, vfc_name) == 0); +} + +/* * Given a filesystem name, determine if it is resident in the kernel, * and if it is resident, return its xvfsconf structure. */ @@ -62,7 +78,9 @@ getvfsbyname(const char *fsname, struct xvfsconf *vfcp } cnt = buflen / sizeof(struct xvfsconf); for (i = 0; i < cnt; i++) { - if (strcmp(fsname, xvfsp[i].vfc_name) == 0) { + if (strcmp(fsname, xvfsp[i].vfc_name) == 0 || + are_fusefs(fsname, xvfsp[i].vfc_name)) + { memcpy(vfcp, xvfsp + i, sizeof(struct xvfsconf)); free(xvfsp); return (0); From owner-svn-src-projects@freebsd.org Mon May 20 20:22:18 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C51E815918EA for ; Mon, 20 May 2019 20:22:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18DEC90CE3; Mon, 20 May 2019 20:22:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x4KKMAk6086300 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 20 May 2019 23:22:14 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x4KKMAk6086300 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x4KKMAAp086299; Mon, 20 May 2019 23:22:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 20 May 2019 23:22:10 +0300 From: Konstantin Belousov To: Alan Somers Cc: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: Re: svn commit: r348007 - projects/fuse2/lib/libc/gen Message-ID: <20190520202210.GT2748@kib.kiev.ua> References: <201905201936.x4KJaaIC023310@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905201936.x4KJaaIC023310@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 20:22:18 -0000 On Mon, May 20, 2019 at 07:36:36PM +0000, Alan Somers wrote: > +static bool > +are_fusefs(const char *fsname, const char *vfc_name) > +{ > + const char fusefs[] = "fusefs"; > + const char fusefs_dot[] = "fusefs."; Both arrays should be static. > + > + return (strncmp(fsname, fusefs_dot, strlen(fusefs_dot)) == 0 && strlen() is not needed, you can use sizeof() - 1. > + strcmp(fusefs, vfc_name) == 0); > +} From owner-svn-src-projects@freebsd.org Mon May 20 20:43:56 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E70F1591FF4 for ; Mon, 20 May 2019 20:43:56 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B61759191A; Mon, 20 May 2019 20:43:55 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf1-f45.google.com with SMTP id y13so11307183lfh.9; Mon, 20 May 2019 13:43:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0egYNnrgAdlz4CkNW5/NWzmZMeaJ6PECNbzx9NKL87k=; b=X3dMsJei6GQ6TeyK+c0fkzHSOhw+9OreX+42jz2xxMp1uMws2XDsVTp+8npa6YFDvQ Dw83VhrU8bXPqTJZXexO/NuIMZYhK3hSZIyJ3C9RQcZdWE/6RNRe56GKkW523WAwvsp0 MvVA1fGr9xW4EJQYQBu9lfSYtyM9lr9190aNKuA74yRsp+IRSckXWT7oQ6qarpqI5e4Z zajcr8Jabf3lLuoR7nQd18i5d2sGW+VteDKduO7/WOosFwUym8c6ZuFmUaD4Mgd9wqNp fkYEe+C4sWqId6ls3s6BYxe/mptaxvzXk25bFrGaICp28FoF3f5VKLJtVGoQg6cV3S5J 4gJQ== X-Gm-Message-State: APjAAAW8SDJRlP1aBVVrW1IsV9zffSh6vBGFnCXYFP3zVbFAWsUNparK t9oJvfgProI5E4WXuVKqQavN5004lNn+9TF2z3opSA== X-Google-Smtp-Source: APXvYqw4EYAVvH/jRjA2OTzxD/uY/Wtig/WRGFpw1GUqGCVNrXshqfLPHbgzJt/UNki0dsZQpQ1oWbHDuP/Wf7Z08Lw= X-Received: by 2002:a19:1908:: with SMTP id 8mr12032922lfz.171.1558385028213; Mon, 20 May 2019 13:43:48 -0700 (PDT) MIME-Version: 1.0 References: <201905201936.x4KJaaIC023310@repo.freebsd.org> <20190520202210.GT2748@kib.kiev.ua> In-Reply-To: <20190520202210.GT2748@kib.kiev.ua> From: Alan Somers Date: Mon, 20 May 2019 14:43:36 -0600 Message-ID: Subject: Re: svn commit: r348007 - projects/fuse2/lib/libc/gen To: Konstantin Belousov Cc: src-committers , svn-src-projects@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: B61759191A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.979,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 20:43:56 -0000 On Mon, May 20, 2019 at 2:22 PM Konstantin Belousov wrote: > > On Mon, May 20, 2019 at 07:36:36PM +0000, Alan Somers wrote: > > +static bool > > +are_fusefs(const char *fsname, const char *vfc_name) > > +{ > > + const char fusefs[] = "fusefs"; > > + const char fusefs_dot[] = "fusefs."; > Both arrays should be static. Ok. > > > + > > + return (strncmp(fsname, fusefs_dot, strlen(fusefs_dot)) == 0 && > strlen() is not needed, you can use sizeof() - 1. > > > + strcmp(fusefs, vfc_name) == 0); > > +} True, but I though that strlen would be more readable. Clang is smart enough to realize that strlen's argument is a constant and omit the call to strlen, so that's what I went with. Is there any other reason to prefer sizeof() - 1 ? -Alan From owner-svn-src-projects@freebsd.org Mon May 20 20:46:52 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 365321592117 for ; Mon, 20 May 2019 20:46:52 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A863991BD9; Mon, 20 May 2019 20:46:51 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x52e.google.com with SMTP id h17so7355709pgv.0; Mon, 20 May 2019 13:46:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=A169L1bLIL8sHsoQQCdUAipmI0VS/y490ayttlG8hqs=; b=eU96LzGCs8lXDkFSJH03/TAE+mGNlrb52ya6MDdzy663PZcb2JFYdc9/NJ1UMNmd3F 43cg/o+ohFyQDAX4jQ/6JmWgCiLU608wMar3H/qUDdt1nqyFlPUJLT+/xgopKbDHtIVN I4gG7DoUFqsVaFQfwZYq/7XrUvsAEeLyjGykQC3gIs2I4gBKThYbplBmhcFzcnTJRzqK RYL4nhfXFWM3h0uhacJYHiMlJzmqAON8Qj6tc6aaE4T3UwGwFvPCsE1/BR7E1cQt8ZIm T6PHL/mxF1fWDYEaqk+/vUGdceS1jrxbKeFy46QiMib47otadGnffDL9mU6purQSU4Sa 8NZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=A169L1bLIL8sHsoQQCdUAipmI0VS/y490ayttlG8hqs=; b=ZgoFKq1f+seuh0218m0J06zjvXnaPRBN+ermVkvxbceimmspU9pz4hhY6C+sx2zgd0 IMjHwD4BQXXJ+Ur/ZkVNr+nb/UL5YvVWcxCI0vHtcWPd477ZOI/DQxle/WQbEUueVK5O wyuhSdY/hxgcW47x6E2x+hKbGzthNT8ppas+2O/+ByLz6B5MlviGFyDfKt0BaVNkPzEV UXV4P4YuXEYRaeaTTFNEw92vracNW9uzNxwGHsjrvU9VoMDz54B+Twd+r7IU63xxRUl9 gGGMu43n+su04w5JJO9c9JgiJK6n1Qoy6OgnTAQeXXvsN2Xt/uTQ0IRFO0B5PD8/r96l aJwQ== X-Gm-Message-State: APjAAAVr5b/OzWm7nHn2YxbGjBMyakAwIeX8lqDBiHaYtK0kk8k5V6k5 ahlB9tQLUNcIKB363PnJFJgaZsFAYkM= X-Google-Smtp-Source: APXvYqxldBLQPePq0nCIr6d0KIjyipJTivZ4QXQx80UoeuJoIPHYYIbOajTZwTFJIVESQIN/SYQhfg== X-Received: by 2002:a62:2805:: with SMTP id o5mr82331445pfo.256.1558385210533; Mon, 20 May 2019 13:46:50 -0700 (PDT) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id x18sm24737948pfj.17.2019.05.20.13.46.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 13:46:50 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: svn commit: r348007 - projects/fuse2/lib/libc/gen From: Enji Cooper In-Reply-To: <20190520202210.GT2748@kib.kiev.ua> Date: Mon, 20 May 2019 13:46:48 -0700 Cc: Alan Somers , src-committers@freebsd.org, svn-src-projects@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <2ED92F08-9353-4476-80B0-F1F8581FC5F1@gmail.com> References: <201905201936.x4KJaaIC023310@repo.freebsd.org> <20190520202210.GT2748@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3445.104.8) X-Rspamd-Queue-Id: A863991BD9 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-1.00)[-0.996,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 20:46:52 -0000 > On May 20, 2019, at 1:22 PM, Konstantin Belousov = wrote: >=20 > On Mon, May 20, 2019 at 07:36:36PM +0000, Alan Somers wrote: >> + >> + return (strncmp(fsname, fusefs_dot, strlen(fusefs_dot)) =3D=3D 0 = && > strlen() is not needed, you can use sizeof() - 1. This only works with single-byte char arrays. strlen is better = (at least easier to spot and replace) when working with multibyte = strings. Thank you, -Enji= From owner-svn-src-projects@freebsd.org Mon May 20 20:51:05 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBB8B159229A for ; Mon, 20 May 2019 20:51:05 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFB8391EDF; Mon, 20 May 2019 20:51:04 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x4KKovtp002036 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 20 May 2019 23:51:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x4KKovtp002036 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x4KKovZC002035; Mon, 20 May 2019 23:50:57 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 20 May 2019 23:50:57 +0300 From: Konstantin Belousov To: Alan Somers Cc: src-committers , svn-src-projects@freebsd.org Subject: Re: svn commit: r348007 - projects/fuse2/lib/libc/gen Message-ID: <20190520205057.GU2748@kib.kiev.ua> References: <201905201936.x4KJaaIC023310@repo.freebsd.org> <20190520202210.GT2748@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 20:51:05 -0000 On Mon, May 20, 2019 at 02:43:36PM -0600, Alan Somers wrote: > On Mon, May 20, 2019 at 2:22 PM Konstantin Belousov wrote: > > > > On Mon, May 20, 2019 at 07:36:36PM +0000, Alan Somers wrote: > > > +static bool > > > +are_fusefs(const char *fsname, const char *vfc_name) > > > +{ > > > + const char fusefs[] = "fusefs"; > > > + const char fusefs_dot[] = "fusefs."; > > Both arrays should be static. > > Ok. > > > > > > + > > > + return (strncmp(fsname, fusefs_dot, strlen(fusefs_dot)) == 0 && > > strlen() is not needed, you can use sizeof() - 1. > > > > > + strcmp(fusefs, vfc_name) == 0); > > > +} > > True, but I though that strlen would be more readable. Clang is smart > enough to realize that strlen's argument is a constant and omit the > call to strlen, so that's what I went with. Is there any other reason > to prefer sizeof() - 1 ? The reason is that it would also work for not so smart compiler, or with a smart compiler after we finally turn on -ffreestanding for libc, as it ought to be. From owner-svn-src-projects@freebsd.org Mon May 20 20:54:10 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BFD41592447 for ; Mon, 20 May 2019 20:54:10 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5398921FE; Mon, 20 May 2019 20:54:09 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EC0D23A46; Mon, 20 May 2019 20:54:09 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4KKs9ZP066632; Mon, 20 May 2019 20:54:09 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KKs9Ls066631; Mon, 20 May 2019 20:54:09 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905202054.x4KKs9Ls066631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 20 May 2019 20:54:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r348009 - projects/fuse2/sys/fs/fuse X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: projects/fuse2/sys/fs/fuse X-SVN-Commit-Revision: 348009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D5398921FE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 20:54:10 -0000 Author: asomers Date: Mon May 20 20:54:09 2019 New Revision: 348009 URL: https://svnweb.freebsd.org/changeset/base/348009 Log: fusefs: unset MNT_LOCAL The kernel can't tell whether or not a fuse file system is truly local. But what really matters is two things: 1) Can I/O to a file system block indefinitely? 2) Can the file system bypass the O_BENEATH restriction during lookup? For fuse, the answer to both of those question is yes. So as far as the kernel is concerned, it's a non-local file system. Sponsored by: The FreeBSD Foundation Modified: projects/fuse2/sys/fs/fuse/fuse_vfsops.c Modified: projects/fuse2/sys/fs/fuse/fuse_vfsops.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_vfsops.c Mon May 20 20:48:04 2019 (r348008) +++ projects/fuse2/sys/fs/fuse/fuse_vfsops.c Mon May 20 20:54:09 2019 (r348009) @@ -335,7 +335,11 @@ fuse_vfsop_mount(struct mount *mp) vfs_getnewfsid(mp); MNT_ILOCK(mp); mp->mnt_data = data; - mp->mnt_flag |= MNT_LOCAL; + /* + * FUSE file systems can be either local or remote, but the kernel + * can't tell the difference. + */ + mp->mnt_flag &= ~MNT_LOCAL; mp->mnt_kern_flag |= MNTK_USES_BCACHE; MNT_IUNLOCK(mp); /* We need this here as this slot is used by getnewvnode() */ From owner-svn-src-projects@freebsd.org Mon May 20 20:55:02 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 259C615924B1 for ; Mon, 20 May 2019 20:55:02 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDE2C92300; Mon, 20 May 2019 20:55:01 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9802A23A48; Mon, 20 May 2019 20:55:01 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4KKt1lZ066753; Mon, 20 May 2019 20:55:01 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KKt12M066752; Mon, 20 May 2019 20:55:01 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905202055.x4KKt12M066752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 20 May 2019 20:55:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r348010 - projects/fuse2/sys/fs/fuse X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: projects/fuse2/sys/fs/fuse X-SVN-Commit-Revision: 348010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BDE2C92300 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 20:55:02 -0000 Author: asomers Date: Mon May 20 20:55:01 2019 New Revision: 348010 URL: https://svnweb.freebsd.org/changeset/base/348010 Log: fusefs: eliminate a superfluous fuse_node_setparent Sponsored by: The FreeBSD Foundation Modified: projects/fuse2/sys/fs/fuse/fuse_vnops.c Modified: projects/fuse2/sys/fs/fuse/fuse_vnops.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_vnops.c Mon May 20 20:54:09 2019 (r348009) +++ projects/fuse2/sys/fs/fuse/fuse_vnops.c Mon May 20 20:55:01 2019 (r348010) @@ -1036,8 +1036,6 @@ fuse_vnop_lookup(struct vop_lookup_args *ap) goto out; *vpp = vp; - fuse_vnode_setparent(vp, dvp); - /* * In the case where we are looking up a FUSE node * represented by an existing cached vnode, and the From owner-svn-src-projects@freebsd.org Mon May 20 22:23:51 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B75A51594A6D for ; Mon, 20 May 2019 22:23:51 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f179.google.com (mail-it1-f179.google.com [209.85.166.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52C3995E9A; Mon, 20 May 2019 22:23:51 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f179.google.com with SMTP id e184so1618871ite.1; Mon, 20 May 2019 15:23:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=y2I1Fg8E/sysHiSQxWycNFoYkCXQLmUICxjxmq/c6qU=; b=RqLf78XD3O++1GwM4bE6VXIjapja0sbvPbGxQSbs3460G3CRHA1YqatE1NNVMUnRAt T/zi4h/iMb6W6q6sdeah6GfvNaS37Vcgg4ucuuIoMTkLc3Fq5E7Uf2Uwh0Yr663mK+Co BS6bBaZ51AzNY7JKS1z6Akq6XGieFPDZXbS2I0Q5iPzOfiKA5rubPHNvb8pCURvmKmKt BV9jpQL8e9CF3s+5ZY0hFPDJBb0vxhQ/CItIi0IDqL0ZyQGcpugs/e8bOMEo1F4fUUJp Flw5v08epkra6a3LER6u4nk6kFYXUVQnG0CkAZIXEEuWDP532cZx4S7mye8zXPeczGOo Qp6g== X-Gm-Message-State: APjAAAWZuHG+mZyfOnGtL5zrgrVDHJc/Xa9kY53+Podu7DP3pzx/tyrc gqYsjmgPwdLrag3fFnUn4AhQgeja X-Google-Smtp-Source: APXvYqyfQ67RhIoanNH+zDIBDxRX1xSmjFogSE5//mt+yLwEZgek24shXWzVpcq06lQnhIibN7zK+Q== X-Received: by 2002:a02:b38e:: with SMTP id p14mr3691904jan.43.1558390637104; Mon, 20 May 2019 15:17:17 -0700 (PDT) Received: from mail-it1-f169.google.com (mail-it1-f169.google.com. [209.85.166.169]) by smtp.gmail.com with ESMTPSA id s10sm5955196iob.29.2019.05.20.15.17.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 15:17:16 -0700 (PDT) Received: by mail-it1-f169.google.com with SMTP id m140so1587707itg.2; Mon, 20 May 2019 15:17:16 -0700 (PDT) X-Received: by 2002:a02:5502:: with SMTP id e2mr5281987jab.87.1558390636563; Mon, 20 May 2019 15:17:16 -0700 (PDT) MIME-Version: 1.0 References: <201905201936.x4KJaaIC023310@repo.freebsd.org> <20190520202210.GT2748@kib.kiev.ua> <20190520205057.GU2748@kib.kiev.ua> In-Reply-To: <20190520205057.GU2748@kib.kiev.ua> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 20 May 2019 15:17:05 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r348007 - projects/fuse2/lib/libc/gen To: Konstantin Belousov Cc: Alan Somers , src-committers , svn-src-projects@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 52C3995E9A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 22:23:51 -0000 On Mon, May 20, 2019 at 1:51 PM Konstantin Belousov wrote: > > On Mon, May 20, 2019 at 02:43:36PM -0600, Alan Somers wrote: > > True, but I though that strlen would be more readable. Clang is smart > > enough to realize that strlen's argument is a constant and omit the > > call to strlen, so that's what I went with. Is there any other reason > > to prefer sizeof() - 1 ? > > The reason is that it would also work for not so smart compiler, or with > a smart compiler after we finally turn on -ffreestanding for libc, as it > ought to be. If we did that, it might make sense to implement strlen() as a macro that did essentially the same thing using __builtin_strlen() (and __builtin_constant_p, if necessary) extensions. Best, Conrad From owner-svn-src-projects@freebsd.org Tue May 21 04:28:01 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEE9015A26DE for ; Tue, 21 May 2019 04:28:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6630674815; Tue, 21 May 2019 04:28:00 +0000 (UTC) (envelope-from ngie@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37491827; Tue, 21 May 2019 04:28:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4L4S0ZS007446; Tue, 21 May 2019 04:28:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4L4RrnU007408; Tue, 21 May 2019 04:27:53 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905210427.x4L4RrnU007408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Tue, 21 May 2019 04:27:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r348048 - in projects/runtime-coverage-v2: . cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common contrib/libarchive contrib/libarchive/cpio/test contrib/libarchi... X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in projects/runtime-coverage-v2: . cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common contrib/libarchive contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/lib... X-SVN-Commit-Revision: 348048 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6630674815 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 04:28:01 -0000 Author: ngie Date: Tue May 21 04:27:52 2019 New Revision: 348048 URL: https://svnweb.freebsd.org/changeset/base/348048 Log: MFhead@r348047 Added: projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_entry_misc.3 - copied unchanged from r348047, head/contrib/libarchive/libarchive/archive_entry_misc.3 projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_mtree_noprint.mtree.uu - copied unchanged from r348047, head/contrib/libarchive/libarchive/test/test_read_format_mtree_noprint.mtree.uu projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_rar5_distance_overflow.rar.uu - copied unchanged from r348047, head/contrib/libarchive/libarchive/test/test_read_format_rar5_distance_overflow.rar.uu projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_rar5_extra_field_version.rar.uu - copied unchanged from r348047, head/contrib/libarchive/libarchive/test/test_read_format_rar5_extra_field_version.rar.uu projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_rar5_fileattr.rar.uu - copied unchanged from r348047, head/contrib/libarchive/libarchive/test/test_read_format_rar5_fileattr.rar.uu projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_rar5_hardlink.rar.uu - copied unchanged from r348047, head/contrib/libarchive/libarchive/test/test_read_format_rar5_hardlink.rar.uu projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_rar5_invalid_dict_reference.rar.uu - copied unchanged from r348047, head/contrib/libarchive/libarchive/test/test_read_format_rar5_invalid_dict_reference.rar.uu projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_rar5_leftshift1.rar.uu - copied unchanged from r348047, head/contrib/libarchive/libarchive/test/test_read_format_rar5_leftshift1.rar.uu projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_rar5_leftshift2.rar.uu - copied unchanged from r348047, head/contrib/libarchive/libarchive/test/test_read_format_rar5_leftshift2.rar.uu projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_rar5_nonempty_dir_stream.rar.uu - copied unchanged from r348047, head/contrib/libarchive/libarchive/test/test_read_format_rar5_nonempty_dir_stream.rar.uu projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_rar5_owner.rar.uu - copied unchanged from r348047, head/contrib/libarchive/libarchive/test/test_read_format_rar5_owner.rar.uu projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_rar5_readtables_overflow.rar.uu - copied unchanged from r348047, head/contrib/libarchive/libarchive/test/test_read_format_rar5_readtables_overflow.rar.uu projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_rar5_symlink.rar.uu - copied unchanged from r348047, head/contrib/libarchive/libarchive/test/test_read_format_rar5_symlink.rar.uu projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_rar5_truncated_huff.rar.uu - copied unchanged from r348047, head/contrib/libarchive/libarchive/test/test_read_format_rar5_truncated_huff.rar.uu projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_rar_ppmd_use_after_free.rar.uu - copied unchanged from r348047, head/contrib/libarchive/libarchive/test/test_read_format_rar_ppmd_use_after_free.rar.uu projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_raw.data.gz.uu - copied unchanged from r348047, head/contrib/libarchive/libarchive/test/test_read_format_raw.data.gz.uu projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_tar_empty_with_gnulabel.c - copied unchanged from r348047, head/contrib/libarchive/libarchive/test/test_read_format_tar_empty_with_gnulabel.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_tar_empty_with_gnulabel.tar.uu - copied unchanged from r348047, head/contrib/libarchive/libarchive/test/test_read_format_tar_empty_with_gnulabel.tar.uu projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_zip_7075_utf8_paths.c - copied unchanged from r348047, head/contrib/libarchive/libarchive/test/test_read_format_zip_7075_utf8_paths.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_zip_7075_utf8_paths.zip.uu - copied unchanged from r348047, head/contrib/libarchive/libarchive/test/test_read_format_zip_7075_utf8_paths.zip.uu projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_zip_extra_padding.c - copied unchanged from r348047, head/contrib/libarchive/libarchive/test/test_read_format_zip_extra_padding.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_zip_extra_padding.zip.uu - copied unchanged from r348047, head/contrib/libarchive/libarchive/test/test_read_format_zip_extra_padding.zip.uu projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_zip_lzma_alone_leak.zipx.uu - copied unchanged from r348047, head/contrib/libarchive/libarchive/test/test_read_format_zip_lzma_alone_leak.zipx.uu projects/runtime-coverage-v2/contrib/libarchive/tar/test/test_option_exclude_vcs.c - copied unchanged from r348047, head/contrib/libarchive/tar/test/test_option_exclude_vcs.c projects/runtime-coverage-v2/lib/libc/gen/group - copied unchanged from r348047, head/lib/libc/gen/group projects/runtime-coverage-v2/lib/libc/gen/master.passwd - copied unchanged from r348047, head/lib/libc/gen/master.passwd projects/runtime-coverage-v2/share/man/man9/DEFINE_IFUNC.9 - copied unchanged from r348047, head/share/man/man9/DEFINE_IFUNC.9 projects/runtime-coverage-v2/sys/dev/usb/usb_fdt_support.c - copied unchanged from r348047, head/sys/dev/usb/usb_fdt_support.c projects/runtime-coverage-v2/sys/dev/usb/usb_fdt_support.h - copied unchanged from r348047, head/sys/dev/usb/usb_fdt_support.h projects/runtime-coverage-v2/sys/modules/lindebugfs/ - copied from r348047, head/sys/modules/lindebugfs/ projects/runtime-coverage-v2/sys/sys/_eventhandler.h - copied unchanged from r348047, head/sys/sys/_eventhandler.h Deleted: projects/runtime-coverage-v2/etc/group projects/runtime-coverage-v2/etc/master.passwd projects/runtime-coverage-v2/share/man/man4/de.4 projects/runtime-coverage-v2/share/man/man4/ed.4 projects/runtime-coverage-v2/share/man/man4/man4.i386/cs.4 projects/runtime-coverage-v2/share/man/man4/man4.i386/ep.4 projects/runtime-coverage-v2/share/man/man4/man4.i386/ex.4 projects/runtime-coverage-v2/share/man/man4/man4.i386/fe.4 projects/runtime-coverage-v2/share/man/man4/man4.i386/vx.4 projects/runtime-coverage-v2/share/man/man4/man4.powerpc/bm.4 projects/runtime-coverage-v2/share/man/man4/pcn.4 projects/runtime-coverage-v2/share/man/man4/sf.4 projects/runtime-coverage-v2/share/man/man4/sn.4 projects/runtime-coverage-v2/share/man/man4/tl.4 projects/runtime-coverage-v2/share/man/man4/tx.4 projects/runtime-coverage-v2/share/man/man4/txp.4 projects/runtime-coverage-v2/share/man/man4/wb.4 projects/runtime-coverage-v2/share/man/man4/xe.4 projects/runtime-coverage-v2/sys/dev/bm/ projects/runtime-coverage-v2/sys/dev/cs/ projects/runtime-coverage-v2/sys/dev/de/ projects/runtime-coverage-v2/sys/dev/ed/ projects/runtime-coverage-v2/sys/dev/ep/ projects/runtime-coverage-v2/sys/dev/ex/ projects/runtime-coverage-v2/sys/dev/fe/ projects/runtime-coverage-v2/sys/dev/pcn/ projects/runtime-coverage-v2/sys/dev/sf/ projects/runtime-coverage-v2/sys/dev/sn/ projects/runtime-coverage-v2/sys/dev/tl/ projects/runtime-coverage-v2/sys/dev/tx/ projects/runtime-coverage-v2/sys/dev/txp/ projects/runtime-coverage-v2/sys/dev/vx/ projects/runtime-coverage-v2/sys/dev/wb/ projects/runtime-coverage-v2/sys/dev/xe/ projects/runtime-coverage-v2/sys/modules/bm/ projects/runtime-coverage-v2/sys/modules/cs/ projects/runtime-coverage-v2/sys/modules/de/ projects/runtime-coverage-v2/sys/modules/ed/ projects/runtime-coverage-v2/sys/modules/ep/ projects/runtime-coverage-v2/sys/modules/ex/ projects/runtime-coverage-v2/sys/modules/fe/ projects/runtime-coverage-v2/sys/modules/pcn/ projects/runtime-coverage-v2/sys/modules/sf/ projects/runtime-coverage-v2/sys/modules/sn/ projects/runtime-coverage-v2/sys/modules/tl/ projects/runtime-coverage-v2/sys/modules/tx/ projects/runtime-coverage-v2/sys/modules/txp/ projects/runtime-coverage-v2/sys/modules/vx/ projects/runtime-coverage-v2/sys/modules/wb/ projects/runtime-coverage-v2/sys/modules/xe/ Modified: projects/runtime-coverage-v2/Makefile.inc1 projects/runtime-coverage-v2/ObsoleteFiles.inc projects/runtime-coverage-v2/UPDATING projects/runtime-coverage-v2/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c projects/runtime-coverage-v2/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c projects/runtime-coverage-v2/contrib/libarchive/NEWS projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_basic.c projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_format_newc.c projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_gcpio_compat.c projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_option_L_upper.c projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_option_a.c projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_option_c.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive.h projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_entry.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_entry.h projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_entry_private.h projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_hmac.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_match.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_platform.h projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_disk_posix.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_private.h projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_set_format.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_format_cab.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_format_mtree.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_format_rar.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_format_rar5.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_format_raw.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_format_tar.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_format_warc.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_format_xar.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_format_zip.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_util.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_write_add_filter_xz.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_write_disk_posix.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_write_set_format_pax.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_write_set_format_xar.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_entry.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_fuzz.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_extract.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_mtree.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_rar.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_rar5.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_rar5_win32.rar.uu projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_raw.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_read_format_zip.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_sparse_basic.c projects/runtime-coverage-v2/contrib/libarchive/libarchive/test/test_write_disk_symlink.c projects/runtime-coverage-v2/contrib/libarchive/tar/bsdtar.1 projects/runtime-coverage-v2/contrib/libarchive/tar/bsdtar.c projects/runtime-coverage-v2/contrib/libarchive/tar/bsdtar.h projects/runtime-coverage-v2/contrib/libarchive/tar/cmdline.c projects/runtime-coverage-v2/contrib/libarchive/tar/test/test_basic.c projects/runtime-coverage-v2/contrib/libarchive/tar/test/test_copy.c projects/runtime-coverage-v2/contrib/libarchive/tar/test/test_option_C_mtree.c projects/runtime-coverage-v2/contrib/libarchive/tar/test/test_option_H_upper.c projects/runtime-coverage-v2/contrib/libarchive/tar/test/test_option_L_upper.c projects/runtime-coverage-v2/contrib/libarchive/tar/test/test_option_U_upper.c projects/runtime-coverage-v2/contrib/libarchive/tar/test/test_option_n.c projects/runtime-coverage-v2/contrib/libarchive/tar/test/test_option_s.c projects/runtime-coverage-v2/contrib/libarchive/tar/test/test_strip_components.c projects/runtime-coverage-v2/contrib/libarchive/tar/test/test_symlink_dir.c projects/runtime-coverage-v2/contrib/libarchive/test_utils/test_common.h projects/runtime-coverage-v2/contrib/libarchive/test_utils/test_main.c projects/runtime-coverage-v2/contrib/wpa/wpa_supplicant/main.c projects/runtime-coverage-v2/contrib/wpa/wpa_supplicant/wpa_supplicant.c projects/runtime-coverage-v2/etc/Makefile projects/runtime-coverage-v2/gnu/usr.bin/binutils/Makefile projects/runtime-coverage-v2/lib/csu/mips/crtn.S projects/runtime-coverage-v2/lib/libarchive/Makefile projects/runtime-coverage-v2/lib/libarchive/tests/Makefile projects/runtime-coverage-v2/lib/libbe/be_access.c projects/runtime-coverage-v2/lib/libc/amd64/sys/amd64_get_fsbase.c projects/runtime-coverage-v2/lib/libc/amd64/sys/amd64_get_gsbase.c projects/runtime-coverage-v2/lib/libc/amd64/sys/amd64_set_fsbase.c projects/runtime-coverage-v2/lib/libc/amd64/sys/amd64_set_gsbase.c projects/runtime-coverage-v2/lib/libc/gen/Makefile.inc projects/runtime-coverage-v2/lib/libc/stdlib/bsearch.3 projects/runtime-coverage-v2/lib/libc/x86/gen/getcontextx.c projects/runtime-coverage-v2/lib/libc/x86/sys/__vdso_gettc.c projects/runtime-coverage-v2/lib/libc/x86/sys/pkru.c projects/runtime-coverage-v2/lib/libomp/Makefile projects/runtime-coverage-v2/lib/libsecureboot/h/libsecureboot.h projects/runtime-coverage-v2/lib/libsecureboot/openpgp/opgp_key.c projects/runtime-coverage-v2/lib/libsecureboot/openpgp/opgp_sig.c projects/runtime-coverage-v2/lib/libsecureboot/tests/tvo.c projects/runtime-coverage-v2/lib/libsecureboot/vepcr.c projects/runtime-coverage-v2/lib/libsecureboot/verify_file.c projects/runtime-coverage-v2/libexec/rc/rc.conf projects/runtime-coverage-v2/libexec/rtld-elf/rtld_malloc.c projects/runtime-coverage-v2/release/powerpc/generate-hfs.sh projects/runtime-coverage-v2/release/powerpc/hfs-boot.bz2.uu projects/runtime-coverage-v2/sbin/fdisk/fdisk.c projects/runtime-coverage-v2/sbin/ifconfig/ifconfig.8 projects/runtime-coverage-v2/sbin/nvmecontrol/nvmecontrol.8 projects/runtime-coverage-v2/share/man/man4/Makefile projects/runtime-coverage-v2/share/man/man4/ae.4 projects/runtime-coverage-v2/share/man/man4/man4.i386/Makefile projects/runtime-coverage-v2/share/man/man4/man4.powerpc/Makefile projects/runtime-coverage-v2/share/man/man4/nvd.4 projects/runtime-coverage-v2/share/man/man4/nvme.4 projects/runtime-coverage-v2/share/man/man5/rc.conf.5 projects/runtime-coverage-v2/share/man/man7/development.7 projects/runtime-coverage-v2/share/man/man9/DRIVER_MODULE.9 projects/runtime-coverage-v2/share/man/man9/Makefile projects/runtime-coverage-v2/share/man/man9/vmem.9 projects/runtime-coverage-v2/share/misc/bsd-family-tree projects/runtime-coverage-v2/stand/common/load_elf.c projects/runtime-coverage-v2/stand/ofw/libofw/ofw_net.c projects/runtime-coverage-v2/stand/ofw/libofw/openfirm.c projects/runtime-coverage-v2/stand/powerpc/Makefile projects/runtime-coverage-v2/stand/powerpc/boot1.chrp/boot1.c projects/runtime-coverage-v2/stand/powerpc/kboot/Makefile projects/runtime-coverage-v2/stand/powerpc/kboot/main.c projects/runtime-coverage-v2/stand/powerpc/ofw/elf_freebsd.c projects/runtime-coverage-v2/stand/powerpc/ofw/ppc64_elf_freebsd.c projects/runtime-coverage-v2/sys/amd64/amd64/copyout.c projects/runtime-coverage-v2/sys/amd64/amd64/fpu.c projects/runtime-coverage-v2/sys/amd64/amd64/machdep.c projects/runtime-coverage-v2/sys/amd64/amd64/pmap.c projects/runtime-coverage-v2/sys/amd64/amd64/support.S projects/runtime-coverage-v2/sys/amd64/amd64/trap.c projects/runtime-coverage-v2/sys/amd64/amd64/vm_machdep.c projects/runtime-coverage-v2/sys/amd64/conf/GENERIC projects/runtime-coverage-v2/sys/amd64/conf/NOTES projects/runtime-coverage-v2/sys/amd64/include/pmap.h projects/runtime-coverage-v2/sys/amd64/include/proc.h projects/runtime-coverage-v2/sys/amd64/linux/linux_machdep.c projects/runtime-coverage-v2/sys/amd64/linux/linux_ptrace.c projects/runtime-coverage-v2/sys/amd64/linux32/linux32_machdep.c projects/runtime-coverage-v2/sys/amd64/vmm/io/iommu.c projects/runtime-coverage-v2/sys/amd64/vmm/x86.c projects/runtime-coverage-v2/sys/arm/allwinner/a10/a10_intc.c projects/runtime-coverage-v2/sys/arm/allwinner/a10_dmac.c projects/runtime-coverage-v2/sys/arm/allwinner/a10_fb.c projects/runtime-coverage-v2/sys/arm/allwinner/a10_hdmi.c projects/runtime-coverage-v2/sys/arm/allwinner/a31_dmac.c projects/runtime-coverage-v2/sys/arm/allwinner/aw_ccu.c projects/runtime-coverage-v2/sys/arm/allwinner/aw_reset.c projects/runtime-coverage-v2/sys/arm/allwinner/aw_rsb.c projects/runtime-coverage-v2/sys/arm/allwinner/aw_spi.c projects/runtime-coverage-v2/sys/arm/allwinner/aw_thermal.c projects/runtime-coverage-v2/sys/arm/allwinner/aw_wdog.c projects/runtime-coverage-v2/sys/arm/allwinner/clkng/aw_ccung.c projects/runtime-coverage-v2/sys/arm/amlogic/aml8726/aml8726_wdt.c projects/runtime-coverage-v2/sys/arm/arm/machdep.c projects/runtime-coverage-v2/sys/arm/arm/pl190.c projects/runtime-coverage-v2/sys/arm/broadcom/bcm2835/bcm2835_rng.c projects/runtime-coverage-v2/sys/arm/broadcom/bcm2835/bcm2835_wdog.c projects/runtime-coverage-v2/sys/arm/broadcom/bcm2835/bcm2836.c projects/runtime-coverage-v2/sys/arm/freescale/imx/imx6_ipu.c projects/runtime-coverage-v2/sys/arm/freescale/imx/imx_wdog.c projects/runtime-coverage-v2/sys/arm/mv/armada/thermal.c projects/runtime-coverage-v2/sys/arm/mv/armada/wdt.c projects/runtime-coverage-v2/sys/arm/mv/mv_spi.c projects/runtime-coverage-v2/sys/arm/mv/timer.c projects/runtime-coverage-v2/sys/arm/nvidia/tegra124/tegra124_machdep.c projects/runtime-coverage-v2/sys/arm/nvidia/tegra124/tegra124_pmc.c projects/runtime-coverage-v2/sys/arm/nvidia/tegra_xhci.c projects/runtime-coverage-v2/sys/arm/rockchip/rk30xx_wdog.c projects/runtime-coverage-v2/sys/arm/ti/am335x/am335x_lcd.c projects/runtime-coverage-v2/sys/arm/ti/am335x/tda19988.c projects/runtime-coverage-v2/sys/arm/ti/ti_pruss.c projects/runtime-coverage-v2/sys/arm/ti/ti_wdt.c projects/runtime-coverage-v2/sys/arm/versatile/versatile_pci.c projects/runtime-coverage-v2/sys/arm/versatile/versatile_sic.c projects/runtime-coverage-v2/sys/arm64/arm64/busdma_bounce.c projects/runtime-coverage-v2/sys/arm64/arm64/elf32_machdep.c projects/runtime-coverage-v2/sys/arm64/arm64/freebsd32_machdep.c projects/runtime-coverage-v2/sys/arm64/arm64/gicv3_its.c projects/runtime-coverage-v2/sys/arm64/arm64/machdep.c projects/runtime-coverage-v2/sys/arm64/coresight/coresight.c projects/runtime-coverage-v2/sys/arm64/include/bus_dma.h projects/runtime-coverage-v2/sys/arm64/include/bus_dma_impl.h projects/runtime-coverage-v2/sys/arm64/include/cpufunc.h projects/runtime-coverage-v2/sys/arm64/include/ifunc.h projects/runtime-coverage-v2/sys/arm64/rockchip/clk/rk_cru.c projects/runtime-coverage-v2/sys/cam/cam_periph.h projects/runtime-coverage-v2/sys/cam/ctl/ctl_ha.c projects/runtime-coverage-v2/sys/cddl/compat/opensolaris/kern/opensolaris.c projects/runtime-coverage-v2/sys/cddl/dev/dtrace/amd64/dtrace_isa.c projects/runtime-coverage-v2/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S projects/runtime-coverage-v2/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c projects/runtime-coverage-v2/sys/compat/lindebugfs/lindebugfs.c projects/runtime-coverage-v2/sys/compat/linux/linux_emul.h projects/runtime-coverage-v2/sys/compat/linux/linux_misc.c projects/runtime-coverage-v2/sys/compat/linux/linux_misc.h projects/runtime-coverage-v2/sys/compat/linux/linux_socket.c projects/runtime-coverage-v2/sys/compat/linuxkpi/common/include/asm/uaccess.h projects/runtime-coverage-v2/sys/compat/linuxkpi/common/include/linux/atomic.h projects/runtime-coverage-v2/sys/compat/linuxkpi/common/include/linux/compiler.h projects/runtime-coverage-v2/sys/compat/linuxkpi/common/include/linux/device.h projects/runtime-coverage-v2/sys/compat/linuxkpi/common/include/linux/interrupt.h projects/runtime-coverage-v2/sys/compat/linuxkpi/common/include/linux/kernel.h projects/runtime-coverage-v2/sys/compat/linuxkpi/common/include/linux/ktime.h projects/runtime-coverage-v2/sys/compat/linuxkpi/common/include/linux/mm_types.h projects/runtime-coverage-v2/sys/compat/linuxkpi/common/include/linux/preempt.h projects/runtime-coverage-v2/sys/compat/linuxkpi/common/include/linux/random.h projects/runtime-coverage-v2/sys/compat/linuxkpi/common/include/linux/sched.h projects/runtime-coverage-v2/sys/compat/linuxkpi/common/include/linux/seq_file.h projects/runtime-coverage-v2/sys/compat/linuxkpi/common/include/linux/uaccess.h projects/runtime-coverage-v2/sys/compat/linuxkpi/common/src/linux_compat.c projects/runtime-coverage-v2/sys/compat/linuxkpi/common/src/linux_current.c projects/runtime-coverage-v2/sys/compat/linuxkpi/common/src/linux_pci.c projects/runtime-coverage-v2/sys/compat/linuxkpi/common/src/linux_tasklet.c projects/runtime-coverage-v2/sys/conf/NOTES projects/runtime-coverage-v2/sys/conf/files projects/runtime-coverage-v2/sys/conf/files.arm64 projects/runtime-coverage-v2/sys/conf/files.i386 projects/runtime-coverage-v2/sys/conf/files.powerpc projects/runtime-coverage-v2/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c projects/runtime-coverage-v2/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c projects/runtime-coverage-v2/sys/crypto/aesni/aesni.c projects/runtime-coverage-v2/sys/crypto/armv8/armv8_crypto.c projects/runtime-coverage-v2/sys/crypto/blake2/blake2_cryptodev.c projects/runtime-coverage-v2/sys/crypto/ccp/ccp.c projects/runtime-coverage-v2/sys/crypto/ccp/ccp_hardware.c projects/runtime-coverage-v2/sys/ddb/db_command.c projects/runtime-coverage-v2/sys/ddb/db_ps.c projects/runtime-coverage-v2/sys/dev/aac/aac_pci.c projects/runtime-coverage-v2/sys/dev/acpi_support/acpi_panasonic.c projects/runtime-coverage-v2/sys/dev/acpica/acpi.c projects/runtime-coverage-v2/sys/dev/acpica/acpi_lid.c projects/runtime-coverage-v2/sys/dev/acpica/acpi_thermal.c projects/runtime-coverage-v2/sys/dev/acpica/acpi_video.c projects/runtime-coverage-v2/sys/dev/acpica/acpivar.h projects/runtime-coverage-v2/sys/dev/adb/adb_kbd.c projects/runtime-coverage-v2/sys/dev/adb/adb_mouse.c projects/runtime-coverage-v2/sys/dev/ae/if_ae.c projects/runtime-coverage-v2/sys/dev/amdsbwd/amdsbwd.c projects/runtime-coverage-v2/sys/dev/atkbdc/psm.c projects/runtime-coverage-v2/sys/dev/bge/if_bge.c projects/runtime-coverage-v2/sys/dev/bge/if_bgereg.h projects/runtime-coverage-v2/sys/dev/cardbus/cardbus.c projects/runtime-coverage-v2/sys/dev/cmx/cmx.c projects/runtime-coverage-v2/sys/dev/coretemp/coretemp.c projects/runtime-coverage-v2/sys/dev/cxgbe/cxgbei/cxgbei.c projects/runtime-coverage-v2/sys/dev/cxgbe/cxgbei/icl_cxgbei.c projects/runtime-coverage-v2/sys/dev/cxgbe/tom/t4_tls.c projects/runtime-coverage-v2/sys/dev/dcons/dcons_crom.c projects/runtime-coverage-v2/sys/dev/dcons/dcons_os.c projects/runtime-coverage-v2/sys/dev/dcons/dcons_os.h projects/runtime-coverage-v2/sys/dev/drm2/ttm/ttm_page_alloc.c projects/runtime-coverage-v2/sys/dev/evdev/evdev_private.h projects/runtime-coverage-v2/sys/dev/extres/syscon/syscon_generic.c projects/runtime-coverage-v2/sys/dev/fb/creator.c projects/runtime-coverage-v2/sys/dev/fb/fbd.c projects/runtime-coverage-v2/sys/dev/firewire/firewire.c projects/runtime-coverage-v2/sys/dev/firewire/fwohci.c projects/runtime-coverage-v2/sys/dev/hdmi/dwc_hdmi.c projects/runtime-coverage-v2/sys/dev/ichwd/ichwd.c projects/runtime-coverage-v2/sys/dev/ida/ida_disk.c projects/runtime-coverage-v2/sys/dev/ida/ida_pci.c projects/runtime-coverage-v2/sys/dev/iir/iir_ctrl.c projects/runtime-coverage-v2/sys/dev/ioat/ioat.c projects/runtime-coverage-v2/sys/dev/ipmi/ipmi.c projects/runtime-coverage-v2/sys/dev/ipmi/ipmi_opal.c projects/runtime-coverage-v2/sys/dev/ips/ips.c projects/runtime-coverage-v2/sys/dev/iscsi/icl_soft_proxy.c projects/runtime-coverage-v2/sys/dev/iscsi_initiator/iscsi.c projects/runtime-coverage-v2/sys/dev/iscsi_initiator/iscsivar.h projects/runtime-coverage-v2/sys/dev/iwm/if_iwm_notif_wait.c projects/runtime-coverage-v2/sys/dev/ksyms/ksyms.c projects/runtime-coverage-v2/sys/dev/led/led.c projects/runtime-coverage-v2/sys/dev/liquidio/lio_bsd.h projects/runtime-coverage-v2/sys/dev/mfi/mfi_disk.c projects/runtime-coverage-v2/sys/dev/mfi/mfi_pci.c projects/runtime-coverage-v2/sys/dev/mfi/mfi_syspd.c projects/runtime-coverage-v2/sys/dev/mlx/mlxvar.h projects/runtime-coverage-v2/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c projects/runtime-coverage-v2/sys/dev/mlx5/mlx5_en/mlx5_en_main.c projects/runtime-coverage-v2/sys/dev/mmc/host/dwmmc.c projects/runtime-coverage-v2/sys/dev/mpr/mprvar.h projects/runtime-coverage-v2/sys/dev/mps/mpsvar.h projects/runtime-coverage-v2/sys/dev/mrsas/mrsas.h projects/runtime-coverage-v2/sys/dev/netmap/if_ptnet.c projects/runtime-coverage-v2/sys/dev/netmap/netmap_freebsd.c projects/runtime-coverage-v2/sys/dev/nmdm/nmdm.c projects/runtime-coverage-v2/sys/dev/ntb/if_ntb/if_ntb.c projects/runtime-coverage-v2/sys/dev/ntb/ntb_hw/ntb_hw_intel.c projects/runtime-coverage-v2/sys/dev/ow/ow.c projects/runtime-coverage-v2/sys/dev/pccard/pccard.c projects/runtime-coverage-v2/sys/dev/pci/pci.c projects/runtime-coverage-v2/sys/dev/pci/pci_host_generic.c projects/runtime-coverage-v2/sys/dev/pci/pci_host_generic_acpi.c projects/runtime-coverage-v2/sys/dev/pci/pci_iov.c projects/runtime-coverage-v2/sys/dev/pci/pci_pci.c projects/runtime-coverage-v2/sys/dev/pci/pcivar.h projects/runtime-coverage-v2/sys/dev/random/ivy.c projects/runtime-coverage-v2/sys/dev/scc/scc_core.c projects/runtime-coverage-v2/sys/dev/scc/scc_dev_quicc.c projects/runtime-coverage-v2/sys/dev/scc/scc_dev_sab82532.c projects/runtime-coverage-v2/sys/dev/scc/scc_dev_z8530.c projects/runtime-coverage-v2/sys/dev/smartpqi/smartpqi_includes.h projects/runtime-coverage-v2/sys/dev/sound/pcm/sound.h projects/runtime-coverage-v2/sys/dev/tws/tws.h projects/runtime-coverage-v2/sys/dev/usb/net/if_cdce.c projects/runtime-coverage-v2/sys/dev/usb/net/if_muge.c projects/runtime-coverage-v2/sys/dev/usb/net/if_mugereg.h projects/runtime-coverage-v2/sys/dev/usb/net/if_smsc.c projects/runtime-coverage-v2/sys/dev/usb/net/if_usie.c projects/runtime-coverage-v2/sys/dev/usb/net/uhso.c projects/runtime-coverage-v2/sys/dev/usb/serial/u3g.c projects/runtime-coverage-v2/sys/dev/usb/usb_device.c projects/runtime-coverage-v2/sys/dev/usb/usbdi.h projects/runtime-coverage-v2/sys/dev/usb/wlan/if_run.c projects/runtime-coverage-v2/sys/dev/veriexec/veriexec_ioctl.h projects/runtime-coverage-v2/sys/dev/veriexec/verified_exec.c projects/runtime-coverage-v2/sys/dev/viawd/viawd.c projects/runtime-coverage-v2/sys/dev/vkbd/vkbd.c projects/runtime-coverage-v2/sys/dev/vmware/vmci/vmci.c projects/runtime-coverage-v2/sys/dev/vt/vt_cpulogos.c projects/runtime-coverage-v2/sys/dev/vt/vt_sysmouse.c projects/runtime-coverage-v2/sys/dev/watchdog/watchdog.c projects/runtime-coverage-v2/sys/dev/xdma/xdma.c projects/runtime-coverage-v2/sys/dev/xdma/xdma_bank.c projects/runtime-coverage-v2/sys/dev/xdma/xdma_bio.c projects/runtime-coverage-v2/sys/dev/xdma/xdma_mbuf.c projects/runtime-coverage-v2/sys/dev/xdma/xdma_queue.c projects/runtime-coverage-v2/sys/dev/xdma/xdma_sg.c projects/runtime-coverage-v2/sys/dev/xen/console/xen_console.c projects/runtime-coverage-v2/sys/dev/xen/debug/debug.c projects/runtime-coverage-v2/sys/fs/devfs/devfs_vnops.c projects/runtime-coverage-v2/sys/i386/conf/GENERIC projects/runtime-coverage-v2/sys/i386/conf/NOTES projects/runtime-coverage-v2/sys/i386/i386/elan-mmcr.c projects/runtime-coverage-v2/sys/i386/i386/geode.c projects/runtime-coverage-v2/sys/i386/i386/longrun.c projects/runtime-coverage-v2/sys/i386/i386/npx.c projects/runtime-coverage-v2/sys/i386/i386/pmap_base.c projects/runtime-coverage-v2/sys/i386/i386/support.s projects/runtime-coverage-v2/sys/kern/bus_if.m projects/runtime-coverage-v2/sys/kern/imgact_elf.c projects/runtime-coverage-v2/sys/kern/init_main.c projects/runtime-coverage-v2/sys/kern/kern_clock.c projects/runtime-coverage-v2/sys/kern/kern_exec.c projects/runtime-coverage-v2/sys/kern/kern_exit.c projects/runtime-coverage-v2/sys/kern/kern_fork.c projects/runtime-coverage-v2/sys/kern/kern_kcov.c projects/runtime-coverage-v2/sys/kern/kern_proc.c projects/runtime-coverage-v2/sys/kern/kern_thread.c projects/runtime-coverage-v2/sys/kern/subr_bus_dma.c projects/runtime-coverage-v2/sys/kern/subr_intr.c projects/runtime-coverage-v2/sys/kern/subr_param.c projects/runtime-coverage-v2/sys/kern/subr_power.c projects/runtime-coverage-v2/sys/kern/subr_turnstile.c projects/runtime-coverage-v2/sys/kern/subr_vmem.c projects/runtime-coverage-v2/sys/kern/tty_tty.c projects/runtime-coverage-v2/sys/kern/vfs_mountroot.c projects/runtime-coverage-v2/sys/kern/vfs_subr.c projects/runtime-coverage-v2/sys/mips/atheros/ar531x/ar5315_wdog.c projects/runtime-coverage-v2/sys/mips/atheros/ar71xx_gpio.c projects/runtime-coverage-v2/sys/mips/atheros/ar71xx_machdep.c projects/runtime-coverage-v2/sys/mips/atheros/ar71xx_wdog.c projects/runtime-coverage-v2/sys/mips/cavium/octeon_wdog.c projects/runtime-coverage-v2/sys/mips/include/pmap.h projects/runtime-coverage-v2/sys/mips/ingenic/jz4780_lcd.c projects/runtime-coverage-v2/sys/mips/mediatek/mtk_spi_v1.c projects/runtime-coverage-v2/sys/mips/mips/pmap.c projects/runtime-coverage-v2/sys/modules/Makefile projects/runtime-coverage-v2/sys/modules/linuxkpi/Makefile projects/runtime-coverage-v2/sys/modules/usb/usb/Makefile projects/runtime-coverage-v2/sys/net/bpf.c projects/runtime-coverage-v2/sys/net/bpf.h projects/runtime-coverage-v2/sys/net/bpf_buffer.c projects/runtime-coverage-v2/sys/net/ethernet.h projects/runtime-coverage-v2/sys/net/if.c projects/runtime-coverage-v2/sys/net/if_clone.h projects/runtime-coverage-v2/sys/net/if_llatbl.c projects/runtime-coverage-v2/sys/net/if_llatbl.h projects/runtime-coverage-v2/sys/net/if_tuntap.c projects/runtime-coverage-v2/sys/net/if_var.h projects/runtime-coverage-v2/sys/net/if_vlan_var.h projects/runtime-coverage-v2/sys/net/route.c projects/runtime-coverage-v2/sys/netinet/if_ether.c projects/runtime-coverage-v2/sys/netinet/in_mcast.c projects/runtime-coverage-v2/sys/netinet/netdump/netdump_client.c projects/runtime-coverage-v2/sys/netinet/sctp_usrreq.c projects/runtime-coverage-v2/sys/netinet/sctputil.c projects/runtime-coverage-v2/sys/netinet/sctputil.h projects/runtime-coverage-v2/sys/netinet/tcp_offload.c projects/runtime-coverage-v2/sys/netinet/toecore.c projects/runtime-coverage-v2/sys/netinet/toecore.h projects/runtime-coverage-v2/sys/netinet6/icmp6.c projects/runtime-coverage-v2/sys/netinet6/in6_mcast.c projects/runtime-coverage-v2/sys/netinet6/nd6.c projects/runtime-coverage-v2/sys/netinet6/nd6_nbr.c projects/runtime-coverage-v2/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c projects/runtime-coverage-v2/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c projects/runtime-coverage-v2/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c projects/runtime-coverage-v2/sys/powerpc/aim/mmu_oea64.c projects/runtime-coverage-v2/sys/powerpc/conf/GENERIC projects/runtime-coverage-v2/sys/powerpc/conf/NOTES projects/runtime-coverage-v2/sys/powerpc/ofw/ofw_machdep.c projects/runtime-coverage-v2/sys/powerpc/powermac/cpcht.c projects/runtime-coverage-v2/sys/powerpc/powermac/cuda.c projects/runtime-coverage-v2/sys/powerpc/powermac/pmu.c projects/runtime-coverage-v2/sys/powerpc/powermac/smu.c projects/runtime-coverage-v2/sys/powerpc/powermac/vcoregpio.c projects/runtime-coverage-v2/sys/powerpc/powernv/opal.h projects/runtime-coverage-v2/sys/powerpc/powernv/opal_async.c projects/runtime-coverage-v2/sys/powerpc/powernv/opal_console.c projects/runtime-coverage-v2/sys/powerpc/powernv/opal_dev.c projects/runtime-coverage-v2/sys/powerpc/powernv/opal_flash.c projects/runtime-coverage-v2/sys/powerpc/powernv/opal_sensor.c projects/runtime-coverage-v2/sys/powerpc/powernv/xive.c projects/runtime-coverage-v2/sys/powerpc/powerpc/cpu.c projects/runtime-coverage-v2/sys/powerpc/powerpc/openpic.c projects/runtime-coverage-v2/sys/powerpc/ps3/ps3bus.c projects/runtime-coverage-v2/sys/powerpc/pseries/rtas_dev.c projects/runtime-coverage-v2/sys/powerpc/pseries/xics.c projects/runtime-coverage-v2/sys/riscv/riscv/intr_machdep.c projects/runtime-coverage-v2/sys/riscv/riscv/machdep.c projects/runtime-coverage-v2/sys/riscv/riscv/mp_machdep.c projects/runtime-coverage-v2/sys/security/audit/audit.c projects/runtime-coverage-v2/sys/security/audit/audit_trigger.c projects/runtime-coverage-v2/sys/security/mac_veriexec/mac_veriexec.c projects/runtime-coverage-v2/sys/security/mac_veriexec/mac_veriexec.h projects/runtime-coverage-v2/sys/security/mac_veriexec/mac_veriexec_internal.h projects/runtime-coverage-v2/sys/security/mac_veriexec/veriexec_metadata.c projects/runtime-coverage-v2/sys/sparc64/conf/GENERIC projects/runtime-coverage-v2/sys/sys/_lock.h projects/runtime-coverage-v2/sys/sys/bus.h projects/runtime-coverage-v2/sys/sys/bus_dma.h projects/runtime-coverage-v2/sys/sys/conf.h projects/runtime-coverage-v2/sys/sys/cpu.h projects/runtime-coverage-v2/sys/sys/disk/mbr.h projects/runtime-coverage-v2/sys/sys/eventhandler.h projects/runtime-coverage-v2/sys/sys/interrupt.h projects/runtime-coverage-v2/sys/sys/lock.h projects/runtime-coverage-v2/sys/sys/malloc.h projects/runtime-coverage-v2/sys/sys/param.h projects/runtime-coverage-v2/sys/sys/pcpu.h projects/runtime-coverage-v2/sys/sys/power.h projects/runtime-coverage-v2/sys/sys/proc.h projects/runtime-coverage-v2/sys/sys/systm.h projects/runtime-coverage-v2/sys/sys/watchdog.h projects/runtime-coverage-v2/sys/vm/memguard.c projects/runtime-coverage-v2/sys/vm/swap_pager.c projects/runtime-coverage-v2/sys/x86/acpica/OsdEnvironment.c projects/runtime-coverage-v2/sys/x86/cpufreq/smist.c projects/runtime-coverage-v2/sys/x86/include/bus_dma.h projects/runtime-coverage-v2/sys/x86/include/busdma_impl.h projects/runtime-coverage-v2/sys/x86/include/ifunc.h projects/runtime-coverage-v2/sys/x86/include/x86_var.h projects/runtime-coverage-v2/sys/x86/iommu/busdma_dmar.c projects/runtime-coverage-v2/sys/x86/iommu/intel_drv.c projects/runtime-coverage-v2/sys/x86/iommu/intel_fault.c projects/runtime-coverage-v2/sys/x86/iommu/intel_gas.c projects/runtime-coverage-v2/sys/x86/iommu/intel_intrmap.c projects/runtime-coverage-v2/sys/x86/iommu/intel_qi.c projects/runtime-coverage-v2/sys/x86/iommu/intel_quirks.c projects/runtime-coverage-v2/sys/x86/x86/busdma_bounce.c projects/runtime-coverage-v2/sys/x86/x86/identcpu.c projects/runtime-coverage-v2/sys/x86/x86/tsc.c projects/runtime-coverage-v2/sys/x86/x86/ucode.c projects/runtime-coverage-v2/tests/sys/netipsec/tunnel/utils.subr projects/runtime-coverage-v2/tests/sys/opencrypto/cryptodev.py projects/runtime-coverage-v2/tests/sys/opencrypto/cryptotest.py projects/runtime-coverage-v2/tests/sys/opencrypto/runtests.sh projects/runtime-coverage-v2/tests/sys/sys/rb_test.c projects/runtime-coverage-v2/tests/sys/sys/splay_test.c projects/runtime-coverage-v2/tools/build/beinstall.sh projects/runtime-coverage-v2/tools/build/mk/OptionalObsoleteFiles.inc projects/runtime-coverage-v2/tools/tools/tinybsd/conf/firewall/etc/rc.firewall projects/runtime-coverage-v2/usr.bin/tar/tests/Makefile projects/runtime-coverage-v2/usr.sbin/bhyve/virtio.c projects/runtime-coverage-v2/usr.sbin/camdd/camdd.c projects/runtime-coverage-v2/usr.sbin/etcupdate/etcupdate.sh projects/runtime-coverage-v2/usr.sbin/jail/jail.8 projects/runtime-coverage-v2/usr.sbin/mergemaster/mergemaster.sh projects/runtime-coverage-v2/usr.sbin/ntp/ntpd/leap-seconds Directory Properties: projects/runtime-coverage-v2/ (props changed) projects/runtime-coverage-v2/cddl/ (props changed) projects/runtime-coverage-v2/cddl/contrib/opensolaris/ (props changed) projects/runtime-coverage-v2/cddl/contrib/opensolaris/cmd/zfs/ (props changed) projects/runtime-coverage-v2/cddl/contrib/opensolaris/lib/libzfs/ (props changed) projects/runtime-coverage-v2/contrib/libarchive/ (props changed) projects/runtime-coverage-v2/contrib/wpa/ (props changed) projects/runtime-coverage-v2/gnu/usr.bin/binutils/ (props changed) projects/runtime-coverage-v2/sys/contrib/ipfilter/ (props changed) Modified: projects/runtime-coverage-v2/Makefile.inc1 ============================================================================== --- projects/runtime-coverage-v2/Makefile.inc1 Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/Makefile.inc1 Tue May 21 04:27:52 2019 (r348048) @@ -874,8 +874,8 @@ DB_FROM_SRC= yes .endif .if defined(DB_FROM_SRC) -INSTALLFLAGS+= -N ${.CURDIR}/etc -MTREEFLAGS+= -N ${.CURDIR}/etc +INSTALLFLAGS+= -N ${.CURDIR}/lib/libc/gen +MTREEFLAGS+= -N ${.CURDIR}/lib/libc/gen .endif _INSTALL_DDIR= ${DESTDIR}/${DISTDIR} INSTALL_DDIR= ${_INSTALL_DDIR:S://:/:g:C:/$::} Modified: projects/runtime-coverage-v2/ObsoleteFiles.inc ============================================================================== --- projects/runtime-coverage-v2/ObsoleteFiles.inc Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/ObsoleteFiles.inc Tue May 21 04:27:52 2019 (r348048) @@ -38,11 +38,39 @@ # xargs -n1 | sort | uniq -d; # done +# 20190517: Remove obsolete 10 and 10/100 ethernet drivers. +OLD_FILES+=usr/share/man/man4/bm.4 +OLD_FILES+=usr/share/man/man4/cs.4 +OLD_FILES+=usr/share/man/man4/de.4 +OLD_FILES+=usr/share/man/man4/if_de.4 +OLD_FILES+=usr/share/man/man4/ed.4 +OLD_FILES+=usr/share/man/man4/if_ed.4 +OLD_FILES+=usr/share/man/man4/ep.4 +OLD_FILES+=usr/share/man/man4/ex.4 +OLD_FILES+=usr/share/man/man4/fe.4 +OLD_FILES+=usr/share/man/man4/pcn.4 +OLD_FILES+=usr/share/man/man4/if_pcn.4 +OLD_FILES+=usr/share/man/man4/sf.4 +OLD_FILES+=usr/share/man/man4/if_sf.4 +OLD_FILES+=usr/share/man/man4/sn.4 +OLD_FILES+=usr/share/man/man4/if_sn.4 +OLD_FILES+=usr/share/man/man4/tl.4 +OLD_FILES+=usr/share/man/man4/if_tl.4 +OLD_FILES+=usr/share/man/man4/tx.4 +OLD_FILES+=usr/share/man/man4/if_tx.4 +OLD_FILES+=usr/share/man/man4/txp.4 +OLD_FILES+=usr/share/man/man4/if_txp.4 +OLD_FILES+=usr/share/man/man4/vx.4 +OLD_FILES+=usr/share/man/man4/wb.4 +OLD_FILES+=usr/share/man/man4/xe.4 +OLD_FILES+=usr/share/man/man4/if_xe.4 # 20190513: libcap_sysctl interface change OLD_FILES+=lib/casper/libcap_sysctl.1 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package. OLD_FILES+=usr/tests/sys/opencrypto/dpkt.py OLD_FILES+=usr/tests/sys/opencrypto/dpkt.pyc +# 20190326: tzdata 2019a import +OLD_FILES+=usr/share/zoneinfo/Etc/UCT # 20190304: new libc++ import which bumps version from 7.0.1 to 8.0.0. OLD_FILES+=usr/include/c++/v1/experimental/dynarray # 20190304: new clang import which bumps version from 7.0.1 to 8.0.0. @@ -201,16 +229,21 @@ OLD_FILES+=usr/include/sys/seq.h OLD_FILES+=usr/lib/libprivateifconfig.a OLD_FILES+=usr/lib/libprivateifconfig_p.a # 20190131: pfil(9) changed -OLD_FILES+=usr/share/man/man9/pfil_hook_get.9 -OLD_FILES+=usr/share/man/man9/pfil_rlock.9 -OLD_FILES+=usr/share/man/man9/pfil_runlock.9 -OLD_FILES+=usr/share/man/man9/pfil_wlock.9 -OLD_FILES+=usr/share/man/man9/pfil_wunlock.9 +OLD_FILES+=usr/share/man/man9/pfil_hook_get.9.gz +OLD_FILES+=usr/share/man/man9/pfil_rlock.9.gz +OLD_FILES+=usr/share/man/man9/pfil_runlock.9.gz +OLD_FILES+=usr/share/man/man9/pfil_wlock.9.gz +OLD_FILES+=usr/share/man/man9/pfil_wunlock.9.gz # 20190126: adv(4) / adw(4) removal OLD_FILES+=usr/share/man/man4/adv.4.gz OLD_FILES+=usr/share/man/man4/adw.4.gz +# 20190123: nonexistant cred_update_thread(9) removed +OLD_FILES+=usr/share/man/man9/cred_update_thread.9.gz # 20190114: old pbuf allocator removed +OLD_FILES+=usr/share/man/man9/getpbuf.9.gz OLD_FILES+=usr/share/man/man9/pbuf.9.gz +OLD_FILES+=usr/share/man/man9/relpbuf.9.gz +OLD_FILES+=usr/share/man/man9/trypbuf.9.gz # 20181219: ibcs removal OLD_FILES+=usr/share/examples/ibcs2/hello.uu OLD_FILES+=usr/share/examples/ibcs2/README Modified: projects/runtime-coverage-v2/UPDATING ============================================================================== --- projects/runtime-coverage-v2/UPDATING Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/UPDATING Tue May 21 04:27:52 2019 (r348048) @@ -31,6 +31,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20190517: + For users of mergemaster, after recent changes to locations of + master.passwd and group in the source tree mergemaster needs to be + updated. Before running `mergemaster -p', cd to usr.sbin/mergemaster + and run `make install'. + 20190513: User-wired pages now have their own counter, vm.stats.vm.v_user_wire_count. The vm.max_wired sysctl was renamed Modified: projects/runtime-coverage-v2/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- projects/runtime-coverage-v2/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue May 21 04:27:52 2019 (r348048) @@ -2361,6 +2361,7 @@ us_compare(const void *larg, const void *rarg, void *u case ZFS_PROP_NAME: propname = "name"; if (numname) { +compare_nums: (void) nvlist_lookup_uint64(lnvl, propname, &lv64); (void) nvlist_lookup_uint64(rnvl, propname, @@ -2368,10 +2369,12 @@ us_compare(const void *larg, const void *rarg, void *u if (rv64 != lv64) rc = (rv64 < lv64) ? 1 : -1; } else { - (void) nvlist_lookup_string(lnvl, propname, - &lvstr); - (void) nvlist_lookup_string(rnvl, propname, - &rvstr); + if ((nvlist_lookup_string(lnvl, propname, + &lvstr) == ENOENT) || + (nvlist_lookup_string(rnvl, propname, + &rvstr) == ENOENT)) { + goto compare_nums; + } rc = strcmp(lvstr, rvstr); } break; Modified: projects/runtime-coverage-v2/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c ============================================================================== --- projects/runtime-coverage-v2/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Tue May 21 04:27:52 2019 (r348048) @@ -114,7 +114,7 @@ get_stats_for_obj(differ_info_t *di, const char *dsnam (void) snprintf(di->errbuf, sizeof (di->errbuf), dgettext(TEXT_DOMAIN, "Unable to determine path or stats for " - "object %lld in %s"), obj, dsname); + "object %jd in %s"), (uintmax_t)obj, dsname); return (-1); } } @@ -406,8 +406,8 @@ write_free_diffs(FILE *fp, differ_info_t *di, dmu_diff } else { (void) snprintf(di->errbuf, sizeof (di->errbuf), dgettext(TEXT_DOMAIN, - "next allocated object (> %lld) find failure"), - zc.zc_obj); + "next allocated object (> %jd) find failure"), + (uintmax_t)zc.zc_obj); di->zerr = errno; break; } Modified: projects/runtime-coverage-v2/contrib/libarchive/NEWS ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/NEWS Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/NEWS Tue May 21 04:27:52 2019 (r348048) @@ -1,3 +1,13 @@ +Apr 16, 2019: Support for non-recursive list and extract + +Apr 14, 2019: New tar option: --exclude-vcs + +Mar 27, 2019: Support for file and directory symlinks on Windows + +Mar 12, 2019: Important fixes for storing file attributes and flags + +Jan 20, 2019: Support for xz, lzma, ppmd8 and bzip2 compression in zip archives + Oct 06, 2018: RAR 5.0 reader Sep 03, 2018: libarchive 3.3.3 released Modified: projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_basic.c ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_basic.c Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_basic.c Tue May 21 04:27:52 2019 (r348048) @@ -46,7 +46,7 @@ verify_files(const char *msg) /* Symlink */ if (canSymlink()) - assertIsSymlink("symlink", "file"); + assertIsSymlink("symlink", "file", 0); /* Another file with 1 link and different permissions. */ failure(msg); @@ -173,7 +173,7 @@ DEFINE_TEST(test_basic) /* Symlink to above file. */ if (canSymlink()) { - assertMakeSymlink("symlink", "file"); + assertMakeSymlink("symlink", "file", 0); fprintf(filelist, "symlink\n"); if (is_LargeInode("symlink")) { strncat(result, Modified: projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_format_newc.c ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_format_newc.c Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_format_newc.c Tue May 21 04:27:52 2019 (r348048) @@ -114,7 +114,7 @@ DEFINE_TEST(test_format_newc) /* "symlink" */ if (canSymlink()) { - assertMakeSymlink("symlink", "file1"); + assertMakeSymlink("symlink", "file1", 0); fprintf(list, "symlink\n"); } @@ -233,7 +233,12 @@ DEFINE_TEST(test_format_newc) assert(is_hex(e, 110)); assertEqualMem(e + 0, "070701", 6); /* Magic */ assert(is_hex(e + 6, 8)); /* ino */ +#if defined(_WIN32) && !defined(CYGWIN) + /* Mode: Group members bits and others bits do not work. */ + assertEqualInt(0xa180, from_hex(e + 14, 8) & 0xffc0); +#else assertEqualInt(0xa1ff, from_hex(e + 14, 8)); /* Mode */ +#endif assertEqualInt(from_hex(e + 22, 8), uid); /* uid */ assertEqualInt(gid, from_hex(e + 30, 8)); /* gid */ assertEqualMem(e + 38, "00000001", 8); /* nlink */ Modified: projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_gcpio_compat.c ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_gcpio_compat.c Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_gcpio_compat.c Tue May 21 04:27:52 2019 (r348048) @@ -71,7 +71,7 @@ unpack_test(const char *from, const char *options, con /* Symlink */ if (canSymlink()) - assertIsSymlink("symlink", "file"); + assertIsSymlink("symlink", "file", 0); /* dir */ assertIsDir("dir", 0775); Modified: projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_option_L_upper.c ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_option_L_upper.c Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_option_L_upper.c Tue May 21 04:27:52 2019 (r348048) @@ -30,8 +30,10 @@ __FBSDID("$FreeBSD$"); * tests won't run on Windows. */ #if defined(_WIN32) && !defined(__CYGWIN__) #define CAT "type" +#define SEP "\\" #else #define CAT "cat" +#define SEP "/" #endif DEFINE_TEST(test_option_L_upper) @@ -51,7 +53,7 @@ DEFINE_TEST(test_option_L_upper) fprintf(filelist, "file\n"); /* Symlink to above file. */ - assertMakeSymlink("symlink", "file"); + assertMakeSymlink("symlink", "file", 0); fprintf(filelist, "symlink\n"); fclose(filelist); @@ -61,7 +63,7 @@ DEFINE_TEST(test_option_L_upper) assertTextFileContents("1 block\n", "copy.err"); failure("Regular -p without -L should preserve symlinks."); - assertIsSymlink("copy/symlink", NULL); + assertIsSymlink("copy/symlink", NULL, 0); r = systemf(CAT " filelist | %s -pd -L copy-L >copy-L.out 2>copy-L.err", testprog); assertEqualInt(r, 0); @@ -77,13 +79,14 @@ DEFINE_TEST(test_option_L_upper) assertMakeDir("unpack", 0755); assertChdir("unpack"); - r = systemf(CAT " ../archive.out | %s -i >unpack.out 2>unpack.err", testprog); + r = systemf(CAT " .." SEP "archive.out | %s -i >unpack.out 2>unpack.err", testprog); + failure("Error invoking %s -i", testprog); assertEqualInt(r, 0); assertTextFileContents("1 block\n", "unpack.err"); assertChdir(".."); - assertIsSymlink("unpack/symlink", NULL); + assertIsSymlink("unpack/symlink", NULL, 0); r = systemf(CAT " filelist | %s -oL >archive-L.out 2>archive-L.err", testprog); failure("Error invoking %s -oL", testprog); @@ -92,7 +95,8 @@ DEFINE_TEST(test_option_L_upper) assertMakeDir("unpack-L", 0755); assertChdir("unpack-L"); - r = systemf(CAT " ../archive-L.out | %s -i >unpack-L.out 2>unpack-L.err", testprog); + r = systemf(CAT " .." SEP "archive-L.out | %s -i >unpack-L.out 2>unpack-L.err", testprog); + failure("Error invoking %s -i < archive-L.out", testprog); assertEqualInt(r, 0); assertTextFileContents("1 block\n", "unpack-L.err"); Modified: projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_option_a.c ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_option_a.c Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_option_a.c Tue May 21 04:27:52 2019 (r348048) @@ -71,8 +71,13 @@ test_create(void) * #ifdef this section out. Most of the test below is * still valid. */ memset(×, 0, sizeof(times)); +#if defined(_WIN32) && !defined(CYGWIN) + times.actime = 86400; + times.modtime = 86400; +#else times.actime = 1; times.modtime = 3; +#endif assertEqualInt(0, utime(files[i].name, ×)); /* Record whatever atime the file ended up with. */ Modified: projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_option_c.c ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_option_c.c Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/cpio/test/test_option_c.c Tue May 21 04:27:52 2019 (r348048) @@ -85,7 +85,7 @@ DEFINE_TEST(test_option_c) /* "symlink" */ if (canSymlink()) { - assertMakeSymlink("symlink", "file"); + assertMakeSymlink("symlink", "file", 0); fprintf(filelist, "symlink\n"); } Modified: projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive.h ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive.h Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive.h Tue May 21 04:27:52 2019 (r348048) @@ -338,9 +338,9 @@ typedef const char *archive_passphrase_callback(struct #define ARCHIVE_FORMAT_LHA 0xB0000 #define ARCHIVE_FORMAT_CAB 0xC0000 #define ARCHIVE_FORMAT_RAR 0xD0000 -#define ARCHIVE_FORMAT_RAR_V5 (ARCHIVE_FORMAT_RAR | 1) #define ARCHIVE_FORMAT_7ZIP 0xE0000 #define ARCHIVE_FORMAT_WARC 0xF0000 +#define ARCHIVE_FORMAT_RAR_V5 0x100000 /* * Codes returned by archive_read_format_capabilities(). @@ -1095,6 +1095,8 @@ __LA_DECL int archive_match_excluded(struct archive *, */ __LA_DECL int archive_match_path_excluded(struct archive *, struct archive_entry *); +/* Control recursive inclusion of directory content when directory is included. Default on. */ +__LA_DECL int archive_match_set_inclusion_recursion(struct archive *, int); /* Add exclusion pathname pattern. */ __LA_DECL int archive_match_exclude_pattern(struct archive *, const char *); __LA_DECL int archive_match_exclude_pattern_w(struct archive *, Modified: projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_entry.c ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_entry.c Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_entry.c Tue May 21 04:27:52 2019 (r348048) @@ -168,6 +168,7 @@ archive_entry_clear(struct archive_entry *entry) archive_entry_xattr_clear(entry); archive_entry_sparse_clear(entry); free(entry->stat); + entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED; memset(entry, 0, sizeof(*entry)); return entry; } @@ -202,6 +203,9 @@ archive_entry_clone(struct archive_entry *entry) entry2->ae_set = entry->ae_set; archive_mstring_copy(&entry2->ae_uname, &entry->ae_uname); + /* Copy symlink type */ + entry2->ae_symlink_type = entry->ae_symlink_type; + /* Copy encryption status */ entry2->encryption = entry->encryption; @@ -253,6 +257,7 @@ archive_entry_new2(struct archive *a) if (entry == NULL) return (NULL); entry->archive = a; + entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED; return (entry); } @@ -675,6 +680,12 @@ archive_entry_symlink(struct archive_entry *entry) return (NULL); } +int +archive_entry_symlink_type(struct archive_entry *entry) +{ + return (entry->ae_symlink_type); +} + const char * archive_entry_symlink_utf8(struct archive_entry *entry) { @@ -1246,6 +1257,12 @@ archive_entry_set_symlink(struct archive_entry *entry, } void +archive_entry_set_symlink_type(struct archive_entry *entry, int type) +{ + entry->ae_symlink_type = type; +} + +void archive_entry_set_symlink_utf8(struct archive_entry *entry, const char *linkname) { archive_mstring_copy_utf8(&entry->ae_symlink, linkname); @@ -1749,6 +1766,10 @@ static const struct flag { { "nohidden", L"nohidden", UF_HIDDEN, 0}, { "nouhidden", L"nouhidden", UF_HIDDEN, 0}, #endif +#ifdef FILE_ATTRIBUTE_HIDDEN + { "nohidden", L"nohidden", FILE_ATTRIBUTE_HIDDEN, 0}, + { "nouhidden", L"nouhidden", FILE_ATTRIBUTE_HIDDEN, 0}, +#endif #ifdef UF_OFFLINE { "nooffline", L"nooffline", UF_OFFLINE, 0}, { "nouoffline", L"nouoffline", UF_OFFLINE, 0}, @@ -1758,6 +1779,11 @@ static const struct flag { { "nourdonly", L"nourdonly", UF_READONLY, 0}, { "noreadonly", L"noreadonly", UF_READONLY, 0}, #endif +#ifdef FILE_ATTRIBUTE_READONLY + { "nordonly", L"nordonly", FILE_ATTRIBUTE_READONLY, 0}, + { "nourdonly", L"nourdonly", FILE_ATTRIBUTE_READONLY, 0}, + { "noreadonly", L"noreadonly", FILE_ATTRIBUTE_READONLY, 0}, +#endif #ifdef UF_SPARSE { "nosparse", L"nosparse", UF_SPARSE, 0}, { "nousparse", L"nousparse", UF_SPARSE, 0}, @@ -1769,6 +1795,10 @@ static const struct flag { #ifdef UF_SYSTEM { "nosystem", L"nosystem", UF_SYSTEM, 0}, { "nousystem", L"nousystem", UF_SYSTEM, 0}, +#endif +#ifdef FILE_ATTRIBUTE_SYSTEM + { "nosystem", L"nosystem", FILE_ATTRIBUTE_SYSTEM, 0}, + { "nousystem", L"nousystem", FILE_ATTRIBUTE_SYSTEM, 0}, #endif #if defined(FS_UNRM_FL) /* 'u' */ { "noundel", L"noundel", FS_UNRM_FL, 0}, Modified: projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_entry.h Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_entry.h Tue May 21 04:27:52 2019 (r348048) @@ -191,6 +191,13 @@ struct archive_entry; #define AE_IFIFO ((__LA_MODE_T)0010000) /* + * Symlink types + */ +#define AE_SYMLINK_TYPE_UNDEFINED 0 +#define AE_SYMLINK_TYPE_FILE 1 +#define AE_SYMLINK_TYPE_DIRECTORY 2 + +/* * Basic object manipulation */ @@ -275,6 +282,7 @@ __LA_DECL int archive_entry_size_is_set(struct archi __LA_DECL const char *archive_entry_strmode(struct archive_entry *); __LA_DECL const char *archive_entry_symlink(struct archive_entry *); __LA_DECL const char *archive_entry_symlink_utf8(struct archive_entry *); +__LA_DECL int archive_entry_symlink_type(struct archive_entry *); __LA_DECL const wchar_t *archive_entry_symlink_w(struct archive_entry *); __LA_DECL la_int64_t archive_entry_uid(struct archive_entry *); __LA_DECL const char *archive_entry_uname(struct archive_entry *); @@ -350,6 +358,7 @@ __LA_DECL void archive_entry_unset_size(struct archive __LA_DECL void archive_entry_copy_sourcepath(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_sourcepath_w(struct archive_entry *, const wchar_t *); __LA_DECL void archive_entry_set_symlink(struct archive_entry *, const char *); +__LA_DECL void archive_entry_set_symlink_type(struct archive_entry *, int); __LA_DECL void archive_entry_set_symlink_utf8(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_symlink(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_symlink_w(struct archive_entry *, const wchar_t *); @@ -692,7 +701,6 @@ __LA_DECL void archive_entry_linkify(struct archive_en struct archive_entry **, struct archive_entry **); __LA_DECL struct archive_entry *archive_entry_partial_links( struct archive_entry_linkresolver *res, unsigned int *links); - #ifdef __cplusplus } #endif Copied: projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_entry_misc.3 (from r348047, head/contrib/libarchive/libarchive/archive_entry_misc.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_entry_misc.3 Tue May 21 04:27:52 2019 (r348048, copy of r348047, head/contrib/libarchive/libarchive/archive_entry_misc.3) @@ -0,0 +1,62 @@ +.\" Copyright (c) 2019 Martin Matuska +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd April 15, 2019 +.Dt ARCHIVE_ENTRY_MISC 3 +.Os +.Sh NAME +.Nm archive_entry_symlink_type , +.Nm archive_entry_set_symlink_type +.Nd miscellaneous functions for manipulating properties of archive_entry. +.Sh LIBRARY +Streaming Archive Library (libarchive, -larchive) +.Sh SYNOPSIS +.In archive_entry.h +.Ft int +.Fn archive_entry_symlink_type "struct archive_entry *a" +.Ft void +.Fn archive_entry_set_symlink_type "struct archive_entry *a" "int" +.Sh DESCRIPTION +The function +.Fn archive_entry_symlink_type +returns and the function +.Fn archive_entry_set_symlink_type +sets the type of the symbolic link stored in an archive entry. These functions +have special meaning on operating systems that support multiple symbolic link +types (e.g. Microsoft Windows). +.Pp +Supported values are: +.Bl -tag -width "AE_SYMLINK_TYPE_DIRECTORY" -compact +.It AE_SYMLINK_TYPE_UNDEFINED +Symbolic link target type is not defined (default on unix systems) +.It AE_SYMLINK_TYPE_FILE +Symbolic link points to a file +.It AE_SYMLINK_TYPE_DIRECTORY +Symbolic link points to a directory +.El +.Sh SEE ALSO +.Xr archive_entry 3 , +.Xr archive_entry_paths 3 , +.Xr archive_entry_stat 3 , +.Xr libarchive 3 Modified: projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_entry_private.h ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_entry_private.h Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_entry_private.h Tue May 21 04:27:52 2019 (r348048) @@ -176,6 +176,9 @@ struct archive_entry { /* Miscellaneous. */ char strmode[12]; + + /* Symlink type support */ + int ae_symlink_type; }; #endif /* ARCHIVE_ENTRY_PRIVATE_H_INCLUDED */ Modified: projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_hmac.c ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_hmac.c Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_hmac.c Tue May 21 04:27:52 2019 (r348048) @@ -83,6 +83,7 @@ __hmac_sha1_cleanup(archive_hmac_sha1_ctx *ctx) static int __hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len) { +#pragma GCC diagnostic ignored "-Wcast-qual" BCRYPT_ALG_HANDLE hAlg; BCRYPT_HASH_HANDLE hHash; DWORD hash_len; Modified: projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_match.c ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_match.c Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_match.c Tue May 21 04:27:52 2019 (r348048) @@ -93,6 +93,9 @@ struct archive_match { /* exclusion/inclusion set flag. */ int setflag; + /* Recursively include directory content? */ + int recursive_include; + /* * Matching filename patterns. */ @@ -223,6 +226,7 @@ archive_match_new(void) return (NULL); a->archive.magic = ARCHIVE_MATCH_MAGIC; a->archive.state = ARCHIVE_STATE_NEW; + a->recursive_include = 1; match_list_init(&(a->inclusions)); match_list_init(&(a->exclusions)); __archive_rb_tree_init(&(a->exclusion_tree), &rb_ops_mbs); @@ -471,6 +475,28 @@ archive_match_path_excluded(struct archive *_a, } /* + * When recursive inclusion of directory content is enabled, + * an inclusion pattern that matches a directory will also + * include everything beneath that directory. Enabled by default. + * + * For compatibility with GNU tar, exclusion patterns always + * match if a subset of the full patch matches (i.e., they are + * are not rooted at the beginning of the path) and thus there + * is no corresponding non-recursive exclusion mode. + */ +int +archive_match_set_inclusion_recursion(struct archive *_a, int enabled) +{ + struct archive_match *a; + + archive_check_magic(_a, ARCHIVE_MATCH_MAGIC, + ARCHIVE_STATE_NEW, "archive_match_set_inclusion_recursion"); + a = (struct archive_match *)_a; + a->recursive_include = enabled; + return (ARCHIVE_OK); +} + +/* * Utility functions to get statistic information for inclusion patterns. */ int @@ -781,7 +807,10 @@ static int match_path_inclusion(struct archive_match *a, struct match *m, int mbs, const void *pn) { - int flag = PATHMATCH_NO_ANCHOR_END; + /* Recursive operation requires only a prefix match. */ + int flag = a->recursive_include ? + PATHMATCH_NO_ANCHOR_END : + 0; int r; if (mbs) { @@ -1232,7 +1261,7 @@ set_timefilter_pathname_mbs(struct archive_match *a, i archive_set_error(&(a->archive), EINVAL, "pathname is empty"); return (ARCHIVE_FAILED); } - if (stat(path, &st) != 0) { + if (la_stat(path, &st) != 0) { archive_set_error(&(a->archive), errno, "Failed to stat()"); return (ARCHIVE_FAILED); } Modified: projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_platform.h ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_platform.h Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_platform.h Tue May 21 04:27:52 2019 (r348048) @@ -69,6 +69,8 @@ * either Windows or Posix APIs. */ #if (defined(__WIN32__) || defined(_WIN32) || defined(__WIN32)) && !defined(__CYGWIN__) #include "archive_windows.h" +#else +#define la_stat(path,stref) stat(path,stref) #endif /* Modified: projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read.c ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read.c Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read.c Tue May 21 04:27:52 2019 (r348048) @@ -611,6 +611,15 @@ choose_filters(struct archive_read *a) return (ARCHIVE_FATAL); } +int +__archive_read_header(struct archive_read *a, struct archive_entry *entry) +{ + if (a->filter->read_header) + return a->filter->read_header(a->filter, entry); + else + return (ARCHIVE_OK); +} + /* * Read header of next entry. */ Modified: projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Tue May 21 04:27:52 2019 (r348048) @@ -191,7 +191,7 @@ archive_read_disk_entry_from_file(struct archive *_a, } } else #endif - if (stat(path, &s) != 0) { + if (la_stat(path, &s) != 0) { archive_set_error(&a->archive, errno, "Can't stat %s", path); return (ARCHIVE_FAILED); Modified: projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_disk_posix.c ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_disk_posix.c Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_disk_posix.c Tue May 21 04:27:52 2019 (r348048) @@ -909,7 +909,7 @@ next_entry(struct archive_read_disk *a, struct tree *t } } break; - } + } } while (lst == NULL); #ifdef __APPLE__ @@ -1295,10 +1295,23 @@ archive_read_disk_descend(struct archive *_a) if (t->visit_type != TREE_REGULAR || !t->descend) return (ARCHIVE_OK); + /* + * We must not treat the initial specified path as a physical dir, + * because if we do then we will try and ascend out of it by opening + * ".." which is (a) wrong and (b) causes spurious permissions errors + * if ".." is not readable by us. Instead, treat it as if it were a + * symlink. (This uses an extra fd, but it can only happen once at the + * top level of a traverse.) But we can't necessarily assume t->st is + * valid here (though t->lst is), which complicates the logic a + * little. + */ if (tree_current_is_physical_dir(t)) { tree_push(t, t->basename, t->current_filesystem_id, t->lst.st_dev, t->lst.st_ino, &t->restore_time); - t->stack->flags |= isDir; + if (t->stack->parent->parent != NULL) + t->stack->flags |= isDir; + else + t->stack->flags |= isDirLink; } else if (tree_current_is_dir(t)) { tree_push(t, t->basename, t->current_filesystem_id, t->st.st_dev, t->st.st_ino, &t->restore_time); @@ -2151,6 +2164,17 @@ tree_open(const char *path, int symlink_mode, int rest static struct tree * tree_reopen(struct tree *t, const char *path, int restore_time) { +#if defined(O_PATH) + /* Linux */ + const int o_flag = O_PATH; +#elif defined(O_SEARCH) + /* SunOS */ + const int o_flag = O_SEARCH; +#elif defined(O_EXEC) + /* FreeBSD */ + const int o_flag = O_EXEC; +#endif + t->flags = (restore_time != 0)?needsRestoreTimes:0; t->flags |= onInitialDir; t->visit_type = 0; @@ -2172,6 +2196,15 @@ tree_reopen(struct tree *t, const char *path, int rest t->stack->flags = needsFirstVisit; t->maxOpenCount = t->openCount = 1; t->initial_dir_fd = open(".", O_RDONLY | O_CLOEXEC); +#if defined(O_PATH) || defined(O_SEARCH) || defined(O_EXEC) + /* + * Most likely reason to fail opening "." is that it's not readable, + * so try again for execute. The consequences of not opening this are + * unhelpful and unnecessary errors later. + */ + if (t->initial_dir_fd < 0) + t->initial_dir_fd = open(".", o_flag | O_CLOEXEC); +#endif __archive_ensure_cloexec_flag(t->initial_dir_fd); t->working_dir_fd = tree_dup(t->initial_dir_fd); return (t); @@ -2479,7 +2512,7 @@ tree_current_stat(struct tree *t) #else if (tree_enter_working_dir(t) != 0) return NULL; - if (stat(tree_current_access_path(t), &t->st) != 0) + if (la_stat(tree_current_access_path(t), &t->st) != 0) #endif return NULL; t->flags |= hasStat; Modified: projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_private.h ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_private.h Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_private.h Tue May 21 04:27:52 2019 (r348048) @@ -98,6 +98,8 @@ struct archive_read_filter { int (*close)(struct archive_read_filter *self); /* Function that handles switching from reading one block to the next/prev */ int (*sswitch)(struct archive_read_filter *self, unsigned int iindex); + /* Read any header metadata if available. */ + int (*read_header)(struct archive_read_filter *self, struct archive_entry *entry); /* My private data. */ void *data; @@ -250,6 +252,7 @@ int64_t __archive_read_seek(struct archive_read*, int6 int64_t __archive_read_filter_seek(struct archive_read_filter *, int64_t, int); int64_t __archive_read_consume(struct archive_read *, int64_t); int64_t __archive_read_filter_consume(struct archive_read_filter *, int64_t); +int __archive_read_header(struct archive_read *, struct archive_entry *); int __archive_read_program(struct archive_read_filter *, const char *); void __archive_read_free_filters(struct archive_read *); struct archive_read_extract *__archive_read_get_extract(struct archive_read *); Modified: projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_set_format.c ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_set_format.c Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_set_format.c Tue May 21 04:27:52 2019 (r348048) @@ -73,6 +73,9 @@ archive_read_set_format(struct archive *_a, int code) case ARCHIVE_FORMAT_RAR: strcpy(str, "rar"); break; + case ARCHIVE_FORMAT_RAR_V5: + strcpy(str, "rar5"); + break; case ARCHIVE_FORMAT_TAR: strcpy(str, "tar"); break; Modified: projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c Tue May 21 04:27:52 2019 (r348048) @@ -37,6 +37,9 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_STRING_H #include #endif +#ifdef HAVE_LIMITS_H +#include +#endif #ifdef HAVE_UNISTD_H #include #endif @@ -45,6 +48,8 @@ __FBSDID("$FreeBSD$"); #endif #include "archive.h" +#include "archive_entry.h" +#include "archive_endian.h" #include "archive_private.h" #include "archive_read_private.h" @@ -56,6 +61,8 @@ struct private_data { size_t out_block_size; int64_t total_out; unsigned long crc; + uint32_t mtime; + char *name; char eof; /* True = found end of compressed data. */ }; @@ -123,7 +130,8 @@ archive_read_support_filter_gzip(struct archive *_a) * count of bits verified, suitable for use by bidder. */ static ssize_t -peek_at_header(struct archive_read_filter *filter, int *pbits) +peek_at_header(struct archive_read_filter *filter, int *pbits, + struct private_data *state) { const unsigned char *p; ssize_t avail, len; @@ -144,7 +152,9 @@ peek_at_header(struct archive_read_filter *filter, int return (0); bits += 3; header_flags = p[3]; - /* Bytes 4-7 are mod time. */ + /* Bytes 4-7 are mod time in little endian. */ + if (state) + state->mtime = archive_le32dec(p + 4); /* Byte 8 is deflate flags. */ /* XXXX TODO: return deflate flags back to consume_header for use in initializing the decompressor. */ @@ -161,6 +171,7 @@ peek_at_header(struct archive_read_filter *filter, int /* Null-terminated optional filename. */ if (header_flags & 8) { + ssize_t file_start = len; do { ++len; if (avail < len) @@ -169,6 +180,12 @@ peek_at_header(struct archive_read_filter *filter, int if (p == NULL) return (0); } while (p[len - 1] != 0); + + if (state) { + /* Reset the name in case of repeat header reads. */ + free(state->name); + state->name = strdup((const char *)&p[file_start]); + } } /* Null-terminated optional comment. */ @@ -214,12 +231,29 @@ gzip_bidder_bid(struct archive_read_filter_bidder *sel (void)self; /* UNUSED */ - if (peek_at_header(filter, &bits_checked)) + if (peek_at_header(filter, &bits_checked, NULL)) return (bits_checked); return (0); } +static int +gzip_read_header(struct archive_read_filter *self, struct archive_entry *entry) +{ + struct private_data *state; + state = (struct private_data *)self->data; + + /* A mtime of 0 is considered invalid/missing. */ + if (state->mtime != 0) + archive_entry_set_mtime(entry, state->mtime, 0); + + /* If the name is available, extract it. */ + if (state->name) + archive_entry_set_pathname(entry, state->name); + + return (ARCHIVE_OK); +} + #ifndef HAVE_ZLIB_H /* @@ -272,6 +306,7 @@ gzip_bidder_init(struct archive_read_filter *self) self->read = gzip_filter_read; self->skip = NULL; /* not supported */ self->close = gzip_filter_close; + self->read_header = gzip_read_header; state->in_stream = 0; /* We're not actually within a stream yet. */ @@ -289,7 +324,7 @@ consume_header(struct archive_read_filter *self) state = (struct private_data *)self->data; /* If this is a real header, consume it. */ - len = peek_at_header(self->upstream, NULL); + len = peek_at_header(self->upstream, NULL, state); if (len == 0) return (ARCHIVE_EOF); __archive_read_filter_consume(self->upstream, len); @@ -374,7 +409,7 @@ gzip_filter_read(struct archive_read_filter *self, con { struct private_data *state; size_t decompressed; - ssize_t avail_in; + ssize_t avail_in, max_in; int ret; state = (struct private_data *)self->data; @@ -408,6 +443,12 @@ gzip_filter_read(struct archive_read_filter *self, con "truncated gzip input"); return (ARCHIVE_FATAL); } + if (UINT_MAX >= SSIZE_MAX) + max_in = SSIZE_MAX; + else + max_in = UINT_MAX; + if (avail_in > max_in) + avail_in = max_in; state->stream.avail_in = (uInt)avail_in; /* Decompress and consume some of that data. */ @@ -469,6 +510,7 @@ gzip_filter_close(struct archive_read_filter *self) } } + free(state->name); free(state->out_block); free(state); return (ret); Modified: projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_format_cab.c ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_format_cab.c Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_format_cab.c Tue May 21 04:27:52 2019 (r348048) @@ -1509,8 +1509,8 @@ cab_read_ahead_cfdata_deflate(struct archive_read *a, } if (mszip == 1 && cab->stream.next_in[0] != 0x4b) goto nomszip; - else if (cab->stream.next_in[0] != 0x43 || - cab->stream.next_in[1] != 0x4b) + else if (mszip == 2 && (cab->stream.next_in[0] != 0x43 || + cab->stream.next_in[1] != 0x4b)) goto nomszip; cab->stream.next_in += mszip; cab->stream.avail_in -= mszip; Modified: projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_format_mtree.c ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Tue May 21 04:27:52 2019 (r348048) @@ -45,6 +45,9 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_STRING_H #include #endif +#ifdef HAVE_CTYPE_H +#include +#endif #include "archive.h" #include "archive_entry.h" @@ -1011,7 +1014,7 @@ read_mtree(struct archive_read *a, struct mtree *mtree { ssize_t len; uintmax_t counter; - char *p; + char *p, *s; struct mtree_option *global; struct mtree_entry *last_entry; int r, is_form_d; @@ -1025,6 +1028,7 @@ read_mtree(struct archive_read *a, struct mtree *mtree (void)detect_form(a, &is_form_d); for (counter = 1; ; ++counter) { + r = ARCHIVE_OK; len = readline(a, mtree, &p, 65536); if (len == 0) { mtree->this_entry = mtree->entries; @@ -1045,6 +1049,15 @@ read_mtree(struct archive_read *a, struct mtree *mtree continue; if (*p == '\r' || *p == '\n' || *p == '\0') continue; + /* Non-printable characters are not allowed */ + for (s = p;s < p + len - 1; s++) { + if (!isprint(*s)) { + r = ARCHIVE_FATAL; + break; + } + } + if (r != ARCHIVE_OK) + break; if (*p != '/') { r = process_add_entry(a, mtree, &global, p, len, &last_entry, is_form_d); Modified: projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_format_rar.c ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_format_rar.c Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_format_rar.c Tue May 21 04:27:52 2019 (r348048) @@ -1024,8 +1024,10 @@ archive_read_format_rar_read_data(struct archive_read case COMPRESS_METHOD_GOOD: case COMPRESS_METHOD_BEST: ret = read_data_compressed(a, buff, size, offset); - if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN) + if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN) { __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context); + rar->start_new_table = 1; + } break; default: Modified: projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_format_rar5.c ============================================================================== --- projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Tue May 21 04:11:16 2019 (r348047) +++ projects/runtime-coverage-v2/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Tue May 21 04:27:52 2019 (r348048) @@ -33,6 +33,9 @@ #ifdef HAVE_ZLIB_H #include /* crc32 */ #endif +#ifdef HAVE_LIMITS_H +#include +#endif #include "archive.h" #ifndef HAVE_ZLIB_H @@ -78,230 +81,275 @@ static unsigned char rar5_signature[] = { 243, 192, 211, 128, 187, 166, 160, 161 }; static const ssize_t rar5_signature_size = sizeof(rar5_signature); -/* static const size_t g_unpack_buf_chunk_size = 1024; */ static const size_t g_unpack_window_size = 0x20000; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@freebsd.org Tue May 21 06:00:15 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7C9F15A3F36 for ; Tue, 21 May 2019 06:00:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1284076C16; Tue, 21 May 2019 06:00:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x4L606Zr031016 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 21 May 2019 09:00:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x4L606Zr031016 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x4L606Un031014; Tue, 21 May 2019 09:00:06 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 21 May 2019 09:00:06 +0300 From: Konstantin Belousov To: Conrad Meyer Cc: Alan Somers , src-committers , svn-src-projects@freebsd.org Subject: Re: svn commit: r348007 - projects/fuse2/lib/libc/gen Message-ID: <20190521060006.GV2748@kib.kiev.ua> References: <201905201936.x4KJaaIC023310@repo.freebsd.org> <20190520202210.GT2748@kib.kiev.ua> <20190520205057.GU2748@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 06:00:15 -0000 On Mon, May 20, 2019 at 03:17:05PM -0700, Conrad Meyer wrote: > On Mon, May 20, 2019 at 1:51 PM Konstantin Belousov wrote: > > > > On Mon, May 20, 2019 at 02:43:36PM -0600, Alan Somers wrote: > > > True, but I though that strlen would be more readable. Clang is smart > > > enough to realize that strlen's argument is a constant and omit the > > > call to strlen, so that's what I went with. Is there any other reason > > > to prefer sizeof() - 1 ? > > > > The reason is that it would also work for not so smart compiler, or with > > a smart compiler after we finally turn on -ffreestanding for libc, as it > > ought to be. > > If we did that, it might make sense to implement strlen() as a macro > that did essentially the same thing using __builtin_strlen() (and > __builtin_constant_p, if necessary) extensions. It is too far-reaching to request to hack strlen() to use gcc extension in response to a simple request to use sizeof() in appropriate situation. From owner-svn-src-projects@freebsd.org Tue May 21 15:59:18 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4BC215B12C0 for ; Tue, 21 May 2019 15:59:18 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BCCF6C0E3; Tue, 21 May 2019 15:59:18 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ABDF7EA1; Tue, 21 May 2019 15:59:18 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4LFxIPo069191; Tue, 21 May 2019 15:59:18 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LFxIHT069190; Tue, 21 May 2019 15:59:18 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905211559.x4LFxIHT069190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 21 May 2019 15:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r348054 - projects/fuse2/lib/libc/gen X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: projects/fuse2/lib/libc/gen X-SVN-Commit-Revision: 348054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7BCCF6C0E3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 15:59:19 -0000 Author: asomers Date: Tue May 21 15:59:17 2019 New Revision: 348054 URL: https://svnweb.freebsd.org/changeset/base/348054 Log: getvfsbyname: prefer sizeof to strlen even for constants Clang is smart enough to evaluate strlen() of a constant at compile-time. However, that won't work in the future if we compile libc with -ffreestanding. Reported by: kib Dissenting: ngie, cem Sponsored by: The FreeBSD Foundation Modified: projects/fuse2/lib/libc/gen/getvfsbyname.c Modified: projects/fuse2/lib/libc/gen/getvfsbyname.c ============================================================================== --- projects/fuse2/lib/libc/gen/getvfsbyname.c Tue May 21 15:19:49 2019 (r348053) +++ projects/fuse2/lib/libc/gen/getvfsbyname.c Tue May 21 15:59:17 2019 (r348054) @@ -49,10 +49,11 @@ __FBSDID("$FreeBSD$"); static bool are_fusefs(const char *fsname, const char *vfc_name) { - const char fusefs[] = "fusefs"; - const char fusefs_dot[] = "fusefs."; + const static char fusefs[] = "fusefs"; + const static char fusefs_dot[] = "fusefs."; - return (strncmp(fsname, fusefs_dot, strlen(fusefs_dot)) == 0 && + + return (strncmp(fsname, fusefs_dot, sizeof(fusefs_dot) - 1) == 0 && strcmp(fusefs, vfc_name) == 0); } From owner-svn-src-projects@freebsd.org Tue May 21 19:34:40 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB9FC15B7751 for ; Tue, 21 May 2019 19:34:40 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B5AF75BBA; Tue, 21 May 2019 19:34:40 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 498A4A41E; Tue, 21 May 2019 19:34:40 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4LJYeep084411; Tue, 21 May 2019 19:34:40 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LJYdgd084408; Tue, 21 May 2019 19:34:39 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905211934.x4LJYdgd084408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 21 May 2019 19:34:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r348062 - in projects/fuse2: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in projects/fuse2: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Commit-Revision: 348062 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6B5AF75BBA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 19:34:41 -0000 Author: asomers Date: Tue May 21 19:34:39 2019 New Revision: 348062 URL: https://svnweb.freebsd.org/changeset/base/348062 Log: fusefs: Allow update mounts Allow "mount -u" to change some mount options for fusefs. Sponsored by: The FreeBSD Foundation Added: projects/fuse2/tests/sys/fs/fusefs/mount.cc (contents, props changed) Modified: projects/fuse2/sys/fs/fuse/fuse_ipc.h projects/fuse2/sys/fs/fuse/fuse_vfsops.c projects/fuse2/tests/sys/fs/fusefs/Makefile Modified: projects/fuse2/sys/fs/fuse/fuse_ipc.h ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_ipc.h Tue May 21 19:23:56 2019 (r348061) +++ projects/fuse2/sys/fs/fuse/fuse_ipc.h Tue May 21 19:34:39 2019 (r348062) @@ -206,6 +206,7 @@ struct fuse_data { int daemon_timeout; uint64_t notimpl; + uint64_t mnt_flag; }; #define FSESS_DEAD 0x0001 /* session is to be closed */ @@ -221,6 +222,11 @@ struct fuse_data { #define FSESS_NO_NAMECACHE 0x0400 /* disable name cache */ #define FSESS_NO_MMAP 0x0800 /* disable mmap */ #define FSESS_POSIX_LOCKS 0x2000 /* daemon supports POSIX locks */ +#define FSESS_MNTOPTS_MASK ( \ + FSESS_DAEMON_CAN_SPY | FSESS_PUSH_SYMLINKS_IN | \ + FSESS_DEFAULT_PERMISSIONS | FSESS_NO_ATTRCACHE | \ + FSESS_NO_READAHEAD | FSESS_NO_DATACACHE | \ + FSESS_NO_NAMECACHE | FSESS_NO_MMAP) enum fuse_data_cache_mode { FUSE_CACHE_UC, Modified: projects/fuse2/sys/fs/fuse/fuse_vfsops.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_vfsops.c Tue May 21 19:23:56 2019 (r348061) +++ projects/fuse2/sys/fs/fuse/fuse_vfsops.c Tue May 21 19:34:39 2019 (r348062) @@ -206,6 +206,57 @@ SDT_PROBE_DEFINE4(fusefs, , vfsops, mount_err, "char*" "struct mount*", "int"); static int +fuse_vfs_remount(struct mount *mp, struct thread *td, uint64_t mntopts, + uint32_t max_read, int daemon_timeout) +{ + int err = 0; + struct fuse_data *data = fuse_get_mpdata(mp); + /* Don't allow these options to be changed */ + const static unsigned long long cant_update_opts = + MNT_USER; /* Mount owner must be the user running the daemon */ + + FUSE_LOCK(); + + if ((mp->mnt_flag ^ data->mnt_flag) & cant_update_opts) { + err = EOPNOTSUPP; + SDT_PROBE4(fusefs, , vfsops, mount_err, + "Can't change these mount options during remount", + data, mp, err); + goto out; + } + if (((data->dataflags ^ mntopts) & FSESS_MNTOPTS_MASK) || + (data->max_read != max_read) || + (data->daemon_timeout != daemon_timeout)) { + // TODO: allow changing options where it makes sense + err = EOPNOTSUPP; + SDT_PROBE4(fusefs, , vfsops, mount_err, + "Can't change fuse mount options during remount", + data, mp, err); + goto out; + } + + if (fdata_get_dead(data)) { + err = ENOTCONN; + SDT_PROBE4(fusefs, , vfsops, mount_err, + "device is dead during mount", data, mp, err); + goto out; + } + + /* Sanity + permission checks */ + if (!data->daemoncred) + panic("fuse daemon found, but identity unknown"); + if (mntopts & FSESS_DAEMON_CAN_SPY) + err = priv_check(td, PRIV_VFS_FUSE_ALLOWOTHER); + if (err == 0 && td->td_ucred->cr_uid != data->daemoncred->cr_uid) + /* are we allowed to do the first mount? */ + err = priv_check(td, PRIV_VFS_FUSE_MOUNT_NONUSER); + +out: + FUSE_UNLOCK(); + return err; +} + +static int fuse_vfsop_mount(struct mount *mp) { int err; @@ -231,12 +282,8 @@ fuse_vfsop_mount(struct mount *mp) __mntopts = 0; td = curthread; - if (mp->mnt_flag & MNT_UPDATE) - return EOPNOTSUPP; - MNT_ILOCK(mp); mp->mnt_flag |= MNT_SYNCHRONOUS; - mp->mnt_data = NULL; MNT_IUNLOCK(mp); /* Get the new options passed to mount */ opts = mp->mnt_optnew; @@ -248,19 +295,6 @@ fuse_vfsop_mount(struct mount *mp) if (!vfs_getopts(opts, "fspath", &err)) return err; - /* `from' contains the device name (eg. /dev/fuse0); REQUIRED */ - fspec = vfs_getopts(opts, "from", &err); - if (!fspec) - return err; - - /* `fd' contains the filedescriptor for this session; REQUIRED */ - if (vfs_scanopt(opts, "fd", "%d", &fd) != 1) - return EINVAL; - - err = fuse_getdevice(fspec, td, &fdev); - if (err != 0) - return err; - /* * With the help of underscored options the mount program * can inform us from the flags it sets by default @@ -287,6 +321,25 @@ fuse_vfsop_mount(struct mount *mp) SDT_PROBE1(fusefs, , vfsops, mntopts, mntopts); + if (mp->mnt_flag & MNT_UPDATE) { + /*dev_rel(fdev);*/ + return fuse_vfs_remount(mp, td, mntopts, max_read, + daemon_timeout); + } + + /* `from' contains the device name (eg. /dev/fuse0); REQUIRED */ + fspec = vfs_getopts(opts, "from", &err); + if (!fspec) + return err; + + /* `fd' contains the filedescriptor for this session; REQUIRED */ + if (vfs_scanopt(opts, "fd", "%d", &fd) != 1) + return EINVAL; + + err = fuse_getdevice(fspec, td, &fdev); + if (err != 0) + return err; + err = fget(td, fd, &cap_read_rights, &fp); if (err != 0) { SDT_PROBE2(fusefs, , vfsops, trace, 1, @@ -330,6 +383,7 @@ fuse_vfsop_mount(struct mount *mp) data->dataflags |= mntopts; data->max_read = max_read; data->daemon_timeout = daemon_timeout; + data->mnt_flag = mp->mnt_flag & MNT_UPDATEMASK; FUSE_UNLOCK(); vfs_getnewfsid(mp); @@ -365,6 +419,7 @@ out: SDT_PROBE4(fusefs, , vfsops, mount_err, "mount failed, destroy device", data, mp, err); data->mp = NULL; + mp->mnt_data = NULL; fdata_trydestroy(data); } FUSE_UNLOCK(); Modified: projects/fuse2/tests/sys/fs/fusefs/Makefile ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/Makefile Tue May 21 19:23:56 2019 (r348061) +++ projects/fuse2/tests/sys/fs/fusefs/Makefile Tue May 21 19:34:39 2019 (r348062) @@ -25,6 +25,7 @@ GTESTS+= locks GTESTS+= lookup GTESTS+= mkdir GTESTS+= mknod +GTESTS+= mount GTESTS+= open GTESTS+= opendir GTESTS+= read Added: projects/fuse2/tests/sys/fs/fusefs/mount.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/fuse2/tests/sys/fs/fusefs/mount.cc Tue May 21 19:34:39 2019 (r348062) @@ -0,0 +1,152 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by BFF Storage Systems, LLC under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +extern "C" { +#include +#include +#include + +#include "mntopts.h" // for build_iovec +} + +#include "mockfs.hh" +#include "utils.hh" + +using namespace testing; + +class UpdateOk: public FuseTest, public WithParamInterface {}; +class UpdateErr: public FuseTest, public WithParamInterface {}; + +int mntflag_from_string(const char *s) +{ + if (0 == strcmp("MNT_RDONLY", s)) + return MNT_RDONLY; + else if (0 == strcmp("MNT_NOEXEC", s)) + return MNT_NOEXEC; + else if (0 == strcmp("MNT_NOSUID", s)) + return MNT_NOSUID; + else if (0 == strcmp("MNT_NOATIME", s)) + return MNT_NOATIME; + else if (0 == strcmp("MNT_SUIDDIR", s)) + return MNT_SUIDDIR; + else if (0 == strcmp("MNT_USER", s)) + return MNT_USER; + else + return 0; +} + +/* Some mount options can be changed by mount -u */ +TEST_P(UpdateOk, update) +{ + struct statfs statbuf; + struct iovec *iov = NULL; + int iovlen = 0; + int flag; + int newflags = MNT_UPDATE | MNT_SYNCHRONOUS; + + flag = mntflag_from_string(GetParam()); + if (flag == MNT_NOSUID && 0 != geteuid()) + GTEST_SKIP() << "Only root may clear MNT_NOSUID"; + if (flag == MNT_SUIDDIR && 0 != geteuid()) + GTEST_SKIP() << "Only root may set MNT_SUIDDIR"; + + EXPECT_CALL(*m_mock, process( + ResultOf([](auto in) { + return (in->header.opcode == FUSE_STATFS); + }, Eq(true)), + _) + ).WillRepeatedly(Invoke(ReturnImmediate([=](auto in __unused, auto out) { + /* + * All of the fields except f_flags are don't care, and f_flags is set by + * the VFS + */ + SET_OUT_HEADER_LEN(out, statfs); + }))); + + ASSERT_EQ(0, statfs("mountpoint", &statbuf)) << strerror(errno); + newflags = (statbuf.f_flags | MNT_UPDATE) ^ flag; + + build_iovec(&iov, &iovlen, "fstype", (void*)statbuf.f_fstypename, -1); + build_iovec(&iov, &iovlen, "fspath", (void*)statbuf.f_mntonname, -1); + build_iovec(&iov, &iovlen, "from", __DECONST(void *, "/dev/fuse"), -1); + ASSERT_EQ(0, nmount(iov, iovlen, newflags)) << strerror(errno); + + ASSERT_EQ(0, statfs("mountpoint", &statbuf)) << strerror(errno); + EXPECT_FALSE((newflags ^ statbuf.f_flags) & flag); +} + +/* Some mount options cannnot be changed by mount -u */ +TEST_P(UpdateErr, update) +{ + struct statfs statbuf; + struct iovec *iov = NULL; + int iovlen = 0; + int flag; + int newflags = MNT_UPDATE | MNT_SYNCHRONOUS; + + flag = mntflag_from_string(GetParam()); + EXPECT_CALL(*m_mock, process( + ResultOf([](auto in) { + return (in->header.opcode == FUSE_STATFS); + }, Eq(true)), + _) + ).WillRepeatedly(Invoke(ReturnImmediate([=](auto in __unused, auto out) { + /* + * All of the fields except f_flags are don't care, and f_flags is set by + * the VFS + */ + SET_OUT_HEADER_LEN(out, statfs); + }))); + + ASSERT_EQ(0, statfs("mountpoint", &statbuf)) << strerror(errno); + newflags = (statbuf.f_flags | MNT_UPDATE) ^ flag; + + build_iovec(&iov, &iovlen, "fstype", (void*)statbuf.f_fstypename, -1); + build_iovec(&iov, &iovlen, "fspath", (void*)statbuf.f_mntonname, -1); + build_iovec(&iov, &iovlen, "from", __DECONST(void *, "/dev/fuse"), -1); + /* + * Don't check nmount's return value, because vfs_domount may "fix" the + * options for us. The important thing is to check the final value of + * statbuf.f_flags below. + */ + (void)nmount(iov, iovlen, newflags); + + ASSERT_EQ(0, statfs("mountpoint", &statbuf)) << strerror(errno); + EXPECT_TRUE((newflags ^ statbuf.f_flags) & flag); +} + +INSTANTIATE_TEST_CASE_P(Mount, UpdateOk, + ::testing::Values("MNT_RDONLY", "MNT_NOEXEC", "MNT_NOSUID", "MNT_NOATIME", + "MNT_SUIDDIR") +); + +INSTANTIATE_TEST_CASE_P(Mount, UpdateErr, + ::testing::Values( "MNT_USER"); +); From owner-svn-src-projects@freebsd.org Wed May 22 19:49:28 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C69915B5DBA for ; Wed, 22 May 2019 19:49:28 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAC5D95B55; Wed, 22 May 2019 19:49:27 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08EBF2215D; Wed, 22 May 2019 19:49:26 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4MJnP99045129; Wed, 22 May 2019 19:49:25 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MJnPpV045128; Wed, 22 May 2019 19:49:25 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905221949.x4MJnPpV045128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 22 May 2019 19:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r348119 - projects/fuse2/sys/fs/fuse X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: projects/fuse2/sys/fs/fuse X-SVN-Commit-Revision: 348119 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DAC5D95B55 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 19:49:28 -0000 Author: asomers Date: Wed May 22 19:49:25 2019 New Revision: 348119 URL: https://svnweb.freebsd.org/changeset/base/348119 Log: fusefs: remove the vfs.fusefs.sync_resize syctl, correctly this time In r347547 I intended to remove the vfs.fusefs.sync_resize sysctl, leaving fusefs's behavior as though sync_resize had its default value. But I forgot that I had already turned off sync_resize in my development system's /etc/sysctl.conf. This commit complete removes the optional behavior that was formerly controlled by sync_resize. There's no need for explicitly calling FUSE_SETATTR after every FUSE_WRITE that extends a file. The daemon can infer that the file is being extended. If this sysctl was added as a workaround for a buggy daemon, there's no clue as to what that daemon may have been. Sponsored by: The FreeBSD Foundation Modified: projects/fuse2/sys/fs/fuse/fuse_io.c Modified: projects/fuse2/sys/fs/fuse/fuse_io.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_io.c Wed May 22 19:39:55 2019 (r348118) +++ projects/fuse2/sys/fs/fuse/fuse_io.c Wed May 22 19:49:25 2019 (r348119) @@ -528,7 +528,6 @@ static int fuse_write_biobackend(struct vnode *vp, struct uio *uio, struct ucred *cred, struct fuse_filehandle *fufh, int ioflag, pid_t pid) { - struct fuse_vnode_data *fvdat = VTOFUD(vp); struct buf *bp; daddr_t lbn; off_t filesize; @@ -749,9 +748,6 @@ again: if (err) break; } while (uio->uio_resid > 0 && n > 0); - - if ((fvdat->flag & FN_SIZECHANGE) != 0) - fuse_vnode_savesize(vp, cred, pid); return (err); } From owner-svn-src-projects@freebsd.org Wed May 22 23:30:52 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3AF315914CF for ; Wed, 22 May 2019 23:30:52 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5337A7099B; Wed, 22 May 2019 23:30:52 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1422E247C2; Wed, 22 May 2019 23:30:52 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4MNUprq062532; Wed, 22 May 2019 23:30:51 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MNUp7u062531; Wed, 22 May 2019 23:30:51 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905222330.x4MNUp7u062531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 22 May 2019 23:30:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r348132 - in projects/fuse2: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in projects/fuse2: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Commit-Revision: 348132 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5337A7099B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 23:30:53 -0000 Author: asomers Date: Wed May 22 23:30:51 2019 New Revision: 348132 URL: https://svnweb.freebsd.org/changeset/base/348132 Log: fusefs: fix "recursing on non recursive lockmgr" panic When mounted with -o default_permissions and when vfs.fusefs.data_cache_mode=2, fuse_io_strategy would try to clear the suid bit after a successful write by a non-owner. When combined with a not-yet-committed attribute-caching patch I'm working on, and if the FUSE_SETATTR response indicates an unexpected filesize (legal, if the file system has other clients), this would end up calling vtruncbuf. That would panic, because the buffer lock was already held by bufwrite or bufstrategy or something else upstack from fuse_vnop_strategy. Sponsored by: The FreeBSD Foundation Modified: projects/fuse2/sys/fs/fuse/fuse_io.c projects/fuse2/tests/sys/fs/fusefs/default_permissions.cc Modified: projects/fuse2/sys/fs/fuse/fuse_io.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_io.c Wed May 22 23:23:16 2019 (r348131) +++ projects/fuse2/sys/fs/fuse/fuse_io.c Wed May 22 23:30:51 2019 (r348132) @@ -883,9 +883,6 @@ fuse_io_strategy(struct vnode *vp, struct buf *bp) bp->b_ioflags |= BIO_ERROR; bp->b_flags |= B_INVAL; bp->b_error = error; - } else { - fuse_io_clear_suid_on_write(vp, cred, - uio.uio_td); } bp->b_dirtyoff = bp->b_dirtyend = 0; } Modified: projects/fuse2/tests/sys/fs/fusefs/default_permissions.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/default_permissions.cc Wed May 22 23:23:16 2019 (r348131) +++ projects/fuse2/tests/sys/fs/fusefs/default_permissions.cc Wed May 22 23:30:51 2019 (r348132) @@ -68,7 +68,7 @@ virtual void SetUp() { } public: -void expect_chmod(uint64_t ino, mode_t mode) +void expect_chmod(uint64_t ino, mode_t mode, uint64_t size = 0) { EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { @@ -82,6 +82,7 @@ void expect_chmod(uint64_t ino, mode_t mode) SET_OUT_HEADER_LEN(out, attr); out->body.attr.attr.ino = ino; // Must match nodeid out->body.attr.attr.mode = S_IFREG | mode; + out->body.attr.attr.size = size; out->body.attr.attr_valid = UINT64_MAX; }))); } @@ -1229,7 +1230,7 @@ TEST_F(Write, clear_suid) expect_lookup(RELPATH, ino, S_IFREG | oldmode, UINT64_MAX); expect_open(ino, 0, 1); expect_write(ino, 0, sizeof(wbuf), sizeof(wbuf), 0, wbuf); - expect_chmod(ino, newmode); + expect_chmod(ino, newmode, sizeof(wbuf)); fd = open(FULLPATH, O_WRONLY); ASSERT_LE(0, fd) << strerror(errno); @@ -1255,7 +1256,7 @@ TEST_F(Write, clear_sgid) expect_lookup(RELPATH, ino, S_IFREG | oldmode, UINT64_MAX); expect_open(ino, 0, 1); expect_write(ino, 0, sizeof(wbuf), sizeof(wbuf), 0, wbuf); - expect_chmod(ino, newmode); + expect_chmod(ino, newmode, sizeof(wbuf)); fd = open(FULLPATH, O_WRONLY); ASSERT_LE(0, fd) << strerror(errno); @@ -1264,3 +1265,34 @@ TEST_F(Write, clear_sgid) EXPECT_EQ(S_IFREG | newmode, sb.st_mode); /* Deliberately leak fd. close(2) will be tested in release.cc */ } + +/* Regression test for a specific recurse-of-nonrecursive-lock panic + * + * With writeback caching, we can't call vtruncbuf from fuse_io_strategy, or it + * may panic. That happens if the FUSE_SETATTR response indicates that the + * file's size has changed since the write. + */ +TEST_F(Write, recursion_panic_while_clearing_suid) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + uint64_t ino = 42; + mode_t oldmode = 04777; + mode_t newmode = 0777; + char wbuf[1] = {'x'}; + int fd; + + expect_getattr(1, S_IFDIR | 0755, UINT64_MAX, 1); + expect_lookup(RELPATH, ino, S_IFREG | oldmode, UINT64_MAX); + expect_open(ino, 0, 1); + expect_write(ino, 0, sizeof(wbuf), sizeof(wbuf), 0, wbuf); + /* XXX Return a smaller file size than what we just wrote! */ + expect_chmod(ino, newmode, 0); + + fd = open(FULLPATH, O_WRONLY); + ASSERT_LE(0, fd) << strerror(errno); + ASSERT_EQ(1, write(fd, wbuf, sizeof(wbuf))) << strerror(errno); + /* Deliberately leak fd. close(2) will be tested in release.cc */ +} + + From owner-svn-src-projects@freebsd.org Thu May 23 00:22:05 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7799A1592741 for ; Thu, 23 May 2019 00:22:05 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18FD572175; Thu, 23 May 2019 00:22:05 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F351425196; Thu, 23 May 2019 00:22:04 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4N0M4Jm093610; Thu, 23 May 2019 00:22:04 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4N0M4vA093606; Thu, 23 May 2019 00:22:04 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905230022.x4N0M4vA093606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 23 May 2019 00:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r348134 - projects/fuse2/sys/fs/fuse X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: projects/fuse2/sys/fs/fuse X-SVN-Commit-Revision: 348134 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 18FD572175 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 00:22:05 -0000 Author: asomers Date: Thu May 23 00:22:03 2019 New Revision: 348134 URL: https://svnweb.freebsd.org/changeset/base/348134 Log: fusefs: improve attribute cacheing Consolidate all calls to fuse_vnode_setsize as a result of a file attribute change to one location in fuse_internal_setattr. There are still a few calls elsewhere that happen as a result of a write. Sponsored by: The FreeBSD Foundation Modified: projects/fuse2/sys/fs/fuse/fuse_internal.c projects/fuse2/sys/fs/fuse/fuse_internal.h projects/fuse2/sys/fs/fuse/fuse_io.c projects/fuse2/sys/fs/fuse/fuse_node.c projects/fuse2/sys/fs/fuse/fuse_vnops.c Modified: projects/fuse2/sys/fs/fuse/fuse_internal.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_internal.c Wed May 22 23:34:41 2019 (r348133) +++ projects/fuse2/sys/fs/fuse/fuse_internal.c Thu May 23 00:22:03 2019 (r348134) @@ -193,8 +193,9 @@ fuse_internal_access(struct vnode *vp, * return the result to the caller). */ void -fuse_internal_cache_attrs(struct vnode *vp, struct fuse_attr *attr, - uint64_t attr_valid, uint32_t attr_valid_nsec, struct vattr *vap) +fuse_internal_cache_attrs(struct vnode *vp, struct ucred *cred, + struct fuse_attr *attr, uint64_t attr_valid, uint32_t attr_valid_nsec, + struct vattr *vap) { struct mount *mp; struct fuse_vnode_data *fvdat; @@ -204,45 +205,53 @@ fuse_internal_cache_attrs(struct vnode *vp, struct fus mp = vnode_mount(vp); fvdat = VTOFUD(vp); data = fuse_get_mpdata(mp); + if (!cred) + cred = curthread->td_ucred; + ASSERT_VOP_ELOCKED(*vpp, "fuse_internal_cache_attrs"); + fuse_validity_2_bintime(attr_valid, attr_valid_nsec, &fvdat->attr_cache_timeout); - vp_cache_at = VTOVA(vp); + /* Fix our buffers if the filesize changed without us knowing */ + if (vnode_isreg(vp) && attr->size != fvdat->cached_attrs.va_size) { + (void)fuse_vnode_setsize(vp, cred, attr->size); + fvdat->cached_attrs.va_size = attr->size; + } - if (vap == NULL && vp_cache_at == NULL) + if (attr_valid > 0 || attr_valid_nsec > 0) + vp_cache_at = &(fvdat->cached_attrs); + else if (vap != NULL) + vp_cache_at = vap; + else return; - if (vap == NULL) - vap = vp_cache_at; - - vattr_null(vap); - - vap->va_fsid = mp->mnt_stat.f_fsid.val[0]; - vap->va_fileid = attr->ino; - vap->va_mode = attr->mode & ~S_IFMT; - vap->va_nlink = attr->nlink; - vap->va_uid = attr->uid; - vap->va_gid = attr->gid; - vap->va_rdev = attr->rdev; - vap->va_size = attr->size; + vattr_null(vp_cache_at); + vp_cache_at->va_fsid = mp->mnt_stat.f_fsid.val[0]; + vp_cache_at->va_fileid = attr->ino; + vp_cache_at->va_mode = attr->mode & ~S_IFMT; + vp_cache_at->va_nlink = attr->nlink; + vp_cache_at->va_uid = attr->uid; + vp_cache_at->va_gid = attr->gid; + vp_cache_at->va_rdev = attr->rdev; + vp_cache_at->va_size = attr->size; /* XXX on i386, seconds are truncated to 32 bits */ - vap->va_atime.tv_sec = attr->atime; - vap->va_atime.tv_nsec = attr->atimensec; - vap->va_mtime.tv_sec = attr->mtime; - vap->va_mtime.tv_nsec = attr->mtimensec; - vap->va_ctime.tv_sec = attr->ctime; - vap->va_ctime.tv_nsec = attr->ctimensec; + vp_cache_at->va_atime.tv_sec = attr->atime; + vp_cache_at->va_atime.tv_nsec = attr->atimensec; + vp_cache_at->va_mtime.tv_sec = attr->mtime; + vp_cache_at->va_mtime.tv_nsec = attr->mtimensec; + vp_cache_at->va_ctime.tv_sec = attr->ctime; + vp_cache_at->va_ctime.tv_nsec = attr->ctimensec; if (fuse_libabi_geq(data, 7, 9) && attr->blksize > 0) - vap->va_blocksize = attr->blksize; + vp_cache_at->va_blocksize = attr->blksize; else - vap->va_blocksize = PAGE_SIZE; - vap->va_type = IFTOVT(attr->mode); - vap->va_bytes = attr->blocks * S_BLKSIZE; - vap->va_flags = 0; + vp_cache_at->va_blocksize = PAGE_SIZE; + vp_cache_at->va_type = IFTOVT(attr->mode); + vp_cache_at->va_bytes = attr->blocks * S_BLKSIZE; + vp_cache_at->va_flags = 0; - if (vap != vp_cache_at && vp_cache_at != NULL) - memcpy(vp_cache_at, vap, sizeof(*vap)); + if (vap != vp_cache_at && vap != NULL) + memcpy(vap, vp_cache_at, sizeof(*vap)); } @@ -560,7 +569,7 @@ fuse_internal_newentry_core(struct vnode *dvp, */ fuse_vnode_clear_attr_cache(dvp); - fuse_internal_cache_attrs(*vpp, &feo->attr, feo->attr_valid, + fuse_internal_cache_attrs(*vpp, NULL, &feo->attr, feo->attr_valid, feo->attr_valid_nsec, NULL); return err; @@ -646,25 +655,15 @@ fuse_internal_do_getattr(struct vnode *vp, struct vatt fao = (struct fuse_attr_out *)fdi.answ; vtyp = IFTOVT(fao->attr.mode); - fuse_internal_cache_attrs(vp, &fao->attr, fao->attr_valid, + if (fvdat->flag & FN_SIZECHANGE) + fao->attr.size = old_filesize; + fuse_internal_cache_attrs(vp, NULL, &fao->attr, fao->attr_valid, fao->attr_valid_nsec, vap); if (vtyp != vnode_vtype(vp)) { fuse_internal_vnode_disappear(vp); err = ENOENT; } - if ((fvdat->flag & FN_SIZECHANGE) != 0) - fvdat->cached_attrs.va_size = old_filesize; - - if (vnode_isreg(vp) && (fvdat->flag & FN_SIZECHANGE) == 0) { - /* - * This is for those cases when the file size changed without us - * knowing, and we want to catch up. - */ - if (old_filesize != fao->attr.size) - fuse_vnode_setsize(vp, cred, fao->attr.size); - } - out: fdisp_destroy(&fdi); return err; @@ -675,14 +674,10 @@ int fuse_internal_getattr(struct vnode *vp, struct vattr *vap, struct ucred *cred, struct thread *td) { - struct fuse_vnode_data *fvdat = VTOFUD(vp); struct vattr *attrs; - off_t old_filesize = vap->va_size; if ((attrs = VTOVA(vp)) != NULL) { *vap = *attrs; /* struct copy */ - if ((fvdat->flag & FN_SIZECHANGE) != 0) - vap->va_size = old_filesize; return 0; } @@ -829,6 +824,7 @@ int fuse_internal_setattr(struct vnode *vp, struct vat fsai->fh = fufh->fh_id; fsai->valid |= FATTR_FH; } + VTOFUD(vp)->flag &= ~FN_SIZECHANGE; } if (vap->va_atime.tv_sec != VNOVAL) { fsai->atime = vap->va_atime.tv_sec; @@ -875,16 +871,12 @@ int fuse_internal_setattr(struct vnode *vp, struct vat } if (err == 0) { struct fuse_attr_out *fao = (struct fuse_attr_out*)fdi.answ; - fuse_internal_cache_attrs(vp, &fao->attr, fao->attr_valid, + fuse_internal_cache_attrs(vp, cred, &fao->attr, fao->attr_valid, fao->attr_valid_nsec, NULL); } out: fdisp_destroy(&fdi); - if (!err && sizechanged) { - fuse_vnode_setsize(vp, cred, newsize); - VTOFUD(vp)->flag &= ~FN_SIZECHANGE; - } return err; } Modified: projects/fuse2/sys/fs/fuse/fuse_internal.h ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_internal.h Wed May 22 23:34:41 2019 (r348133) +++ projects/fuse2/sys/fs/fuse/fuse_internal.h Thu May 23 00:22:03 2019 (r348134) @@ -209,8 +209,9 @@ int fuse_internal_access(struct vnode *vp, accmode_t m struct thread *td, struct ucred *cred); /* attributes */ -void fuse_internal_cache_attrs(struct vnode *vp, struct fuse_attr *attr, - uint64_t attr_valid, uint32_t attr_valid_nsec, struct vattr *vap); +void fuse_internal_cache_attrs(struct vnode *vp, struct ucred *cred, + struct fuse_attr *attr, uint64_t attr_valid, uint32_t attr_valid_nsec, + struct vattr *vap); /* fsync */ Modified: projects/fuse2/sys/fs/fuse/fuse_io.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_io.c Wed May 22 23:34:41 2019 (r348133) +++ projects/fuse2/sys/fs/fuse/fuse_io.c Thu May 23 00:22:03 2019 (r348134) @@ -473,10 +473,10 @@ retry: as_written_offset = uio->uio_offset - diff; if (as_written_offset - diff > filesize && - fuse_data_cache_mode != FUSE_CACHE_UC) { + fuse_data_cache_mode != FUSE_CACHE_UC) fuse_vnode_setsize(vp, cred, as_written_offset); + if (as_written_offset - diff >= filesize) fvdat->flag &= ~FN_SIZECHANGE; - } if (diff < 0) { printf("WARNING: misbehaving FUSE filesystem " @@ -528,6 +528,7 @@ static int fuse_write_biobackend(struct vnode *vp, struct uio *uio, struct ucred *cred, struct fuse_filehandle *fufh, int ioflag, pid_t pid) { + struct fuse_vnode_data *fvdat = VTOFUD(vp); struct buf *bp; daddr_t lbn; off_t filesize; @@ -590,6 +591,8 @@ again: err = fuse_vnode_setsize(vp, cred, uio->uio_offset + n); + fvdat->flag |= FN_SIZECHANGE; + if (err) { brelse(bp); break; @@ -617,10 +620,11 @@ again: if (bp && uio->uio_offset + n > filesize) { err = fuse_vnode_setsize(vp, cred, uio->uio_offset + n); + fvdat->flag |= FN_SIZECHANGE; if (err) { brelse(bp); break; - } + } } } Modified: projects/fuse2/sys/fs/fuse/fuse_node.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_node.c Wed May 22 23:34:41 2019 (r348133) +++ projects/fuse2/sys/fs/fuse/fuse_node.c Thu May 23 00:22:03 2019 (r348134) @@ -400,7 +400,6 @@ fuse_vnode_setsize(struct vnode *vp, struct ucred *cre fvdat->cached_attrs.va_size = newsize; if ((attrs = VTOVA(vp)) != NULL) attrs->va_size = newsize; - fvdat->flag |= FN_SIZECHANGE; if (newsize < oldsize) { daddr_t lbn; Modified: projects/fuse2/sys/fs/fuse/fuse_vnops.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_vnops.c Wed May 22 23:34:41 2019 (r348133) +++ projects/fuse2/sys/fs/fuse/fuse_vnops.c Thu May 23 00:22:03 2019 (r348134) @@ -624,7 +624,7 @@ fuse_vnop_create(struct vop_create_args *ap) goto out; } ASSERT_VOP_ELOCKED(*vpp, "fuse_vnop_create"); - fuse_internal_cache_attrs(*vpp, &feo->attr, feo->attr_valid, + fuse_internal_cache_attrs(*vpp, cred, &feo->attr, feo->attr_valid, feo->attr_valid_nsec, NULL); fuse_filehandle_init(*vpp, FUFH_RDWR, NULL, td, cred, foo); @@ -790,6 +790,7 @@ fuse_vnop_link(struct vop_link_args *ap) struct vnode *vp = ap->a_vp; struct vnode *tdvp = ap->a_tdvp; struct componentname *cnp = ap->a_cnp; + struct ucred *cred = cnp->cn_cred; struct vattr *vap = VTOVA(vp); @@ -831,7 +832,7 @@ fuse_vnop_link(struct vop_link_args *ap) * should've updated its mtime and ctime */ fuse_vnode_clear_attr_cache(tdvp); - fuse_internal_cache_attrs(vp, &feo->attr, feo->attr_valid, + fuse_internal_cache_attrs(vp, cred, &feo->attr, feo->attr_valid, feo->attr_valid_nsec, NULL); } out: @@ -1040,17 +1041,17 @@ fuse_vnop_lookup(struct vop_lookup_args *ap) * In the case where we are looking up a FUSE node * represented by an existing cached vnode, and the * true size reported by FUSE_LOOKUP doesn't match - * the vnode's cached size, fix the vnode cache to - * match the real object size. + * the vnode's cached size, then any cached writes + * beyond the file's current size are lost. * * We can get here: * * following attribute cache expiration, or * * due a bug in the daemon, or - * * the first time that we looked up the file. */ fvdat = VTOFUD(vp); if (vnode_isreg(vp) && - filesize != fvdat->cached_attrs.va_size) { + filesize != fvdat->cached_attrs.va_size && + fvdat->flag & FN_SIZECHANGE) { /* * The FN_SIZECHANGE flag reflects a dirty * append. If userspace lets us know our cache @@ -1060,17 +1061,15 @@ fuse_vnop_lookup(struct vop_lookup_args *ap) * * XXX: Maybe disable WB caching on this mount. */ - if (fvdat->flag & FN_SIZECHANGE) - printf("%s: WB cache incoherent on " - "%s!\n", __func__, - vnode_mount(vp)->mnt_stat.f_mntonname); + printf("%s: WB cache incoherent on %s!\n", + __func__, + vnode_mount(vp)->mnt_stat.f_mntonname); - (void)fuse_vnode_setsize(vp, cred, filesize); fvdat->flag &= ~FN_SIZECHANGE; } MPASS(feo != NULL); - fuse_internal_cache_attrs(*vpp, &feo->attr, + fuse_internal_cache_attrs(*vpp, cred, &feo->attr, feo->attr_valid, feo->attr_valid_nsec, NULL); if ((nameiop == DELETE || nameiop == RENAME) && From owner-svn-src-projects@freebsd.org Thu May 23 00:44:05 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA9311592D9D for ; Thu, 23 May 2019 00:44:04 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6497672B1D; Thu, 23 May 2019 00:44:04 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E1312550D; Thu, 23 May 2019 00:44:04 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4N0i49W004211; Thu, 23 May 2019 00:44:04 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4N0i2or004201; Thu, 23 May 2019 00:44:02 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905230044.x4N0i2or004201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 23 May 2019 00:44:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r348135 - in projects/fuse2: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in projects/fuse2: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Commit-Revision: 348135 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6497672B1D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 00:44:05 -0000 Author: asomers Date: Thu May 23 00:44:01 2019 New Revision: 348135 URL: https://svnweb.freebsd.org/changeset/base/348135 Log: fusefs: Make fuse file systems NFS-exportable This commit adds the VOPs needed by userspace NFS servers (tested with net/unfs3). More work is needed to make the in-kernel nfsd work, because of its stateless nature. It doesn't open files prior to doing I/O. Also, the NFS-related VOPs currently ignore the entry cache. Sponsored by: The FreeBSD Foundation Added: projects/fuse2/tests/sys/fs/fusefs/nfs.cc (contents, props changed) Modified: projects/fuse2/sys/fs/fuse/fuse_internal.c projects/fuse2/sys/fs/fuse/fuse_ipc.h projects/fuse2/sys/fs/fuse/fuse_node.c projects/fuse2/sys/fs/fuse/fuse_node.h projects/fuse2/sys/fs/fuse/fuse_vfsops.c projects/fuse2/sys/fs/fuse/fuse_vnops.c projects/fuse2/tests/sys/fs/fusefs/Makefile projects/fuse2/tests/sys/fs/fusefs/readdir.cc projects/fuse2/tests/sys/fs/fusefs/utils.cc projects/fuse2/tests/sys/fs/fusefs/utils.hh Modified: projects/fuse2/sys/fs/fuse/fuse_internal.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_internal.c Thu May 23 00:22:03 2019 (r348134) +++ projects/fuse2/sys/fs/fuse/fuse_internal.c Thu May 23 00:44:01 2019 (r348135) @@ -727,6 +727,8 @@ fuse_internal_init_callback(struct fuse_ticket *tick, data->max_write = fiio->max_write; if (fiio->flags & FUSE_POSIX_LOCKS) data->dataflags |= FSESS_POSIX_LOCKS; + if (fiio->flags & FUSE_EXPORT_SUPPORT) + data->dataflags |= FSESS_EXPORT_SUPPORT; } else { err = EINVAL; } @@ -764,7 +766,7 @@ fuse_internal_send_init(struct fuse_data *data, struct * the size of a buffer cache block. */ fiii->max_readahead = maxbcachebuf; - fiii->flags = FUSE_POSIX_LOCKS; + fiii->flags = FUSE_EXPORT_SUPPORT | FUSE_POSIX_LOCKS; fuse_insert_callback(fdi.tick, fuse_internal_init_callback); fuse_insert_message(fdi.tick, false); Modified: projects/fuse2/sys/fs/fuse/fuse_ipc.h ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_ipc.h Thu May 23 00:22:03 2019 (r348134) +++ projects/fuse2/sys/fs/fuse/fuse_ipc.h Thu May 23 00:44:01 2019 (r348135) @@ -222,6 +222,7 @@ struct fuse_data { #define FSESS_NO_NAMECACHE 0x0400 /* disable name cache */ #define FSESS_NO_MMAP 0x0800 /* disable mmap */ #define FSESS_POSIX_LOCKS 0x2000 /* daemon supports POSIX locks */ +#define FSESS_EXPORT_SUPPORT 0x10000 /* daemon supports NFS-style lookups */ #define FSESS_MNTOPTS_MASK ( \ FSESS_DAEMON_CAN_SPY | FSESS_PUSH_SYMLINKS_IN | \ FSESS_DEFAULT_PERMISSIONS | FSESS_NO_ATTRCACHE | \ Modified: projects/fuse2/sys/fs/fuse/fuse_node.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_node.c Thu May 23 00:22:03 2019 (r348134) +++ projects/fuse2/sys/fs/fuse/fuse_node.c Thu May 23 00:44:01 2019 (r348135) @@ -77,7 +77,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -165,18 +164,12 @@ fuse_vnode_destroy(struct vnode *vp) atomic_subtract_acq_int(&fuse_node_count, 1); } -static int +int fuse_vnode_cmp(struct vnode *vp, void *nidp) { return (VTOI(vp) != *((uint64_t *)nidp)); } -static uint32_t inline -fuse_vnode_hash(uint64_t id) -{ - return (fnv_32_buf(&id, sizeof(id), FNV1_32_INIT)); -} - SDT_PROBE_DEFINE3(fusefs, , node, stale_vnode, "struct vnode*", "enum vtype", "uint64_t"); static int @@ -215,6 +208,7 @@ fuse_vnode_alloc(struct mount *mp, return (EAGAIN); } MPASS((*vpp)->v_data != NULL); + MPASS(VTOFUD(*vpp)->nid == nodeid); SDT_PROBE2(fusefs, , node, trace, 1, "vnode taken from hash"); return (0); } @@ -269,6 +263,7 @@ fuse_vnode_get(struct mount *mp, enum vtype vtyp) { struct thread *td = (cnp != NULL ? cnp->cn_thread : curthread); + uint64_t generation = feo ? feo->generation : 1; int err = 0; err = fuse_vnode_alloc(mp, td, nodeid, vtyp, vpp); @@ -293,10 +288,11 @@ fuse_vnode_get(struct mount *mp, cache_enter_time(dvp, *vpp, cnp, &timeout, NULL); } + VTOFUD(*vpp)->generation = generation; /* * In userland, libfuse uses cached lookups for dot and dotdot entries, * thus it does not really bump the nlookup counter for forget. - * Follow the same semantic and avoid tu bump it in order to keep + * Follow the same semantic and avoid the bump in order to keep * nlookup counters consistent. */ if (cnp == NULL || ((cnp->cn_flags & ISDOTDOT) == 0 && Modified: projects/fuse2/sys/fs/fuse/fuse_node.h ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_node.h Thu May 23 00:22:03 2019 (r348134) +++ projects/fuse2/sys/fs/fuse/fuse_node.h Thu May 23 00:44:01 2019 (r348135) @@ -60,6 +60,7 @@ #ifndef _FUSE_NODE_H_ #define _FUSE_NODE_H_ +#include #include #include @@ -75,10 +76,13 @@ */ #define FN_SIZECHANGE 0x00000100 #define FN_DIRECTIO 0x00000200 +/* Indicates that parent_nid is valid */ +#define FN_PARENT_NID 0x00000400 struct fuse_vnode_data { /** self **/ uint64_t nid; + uint64_t generation; /** parent **/ uint64_t parent_nid; @@ -98,6 +102,17 @@ struct fuse_vnode_data { enum vtype vtype; }; +/* + * This overlays the fid structure (see mount.h). Mostly the same as the types + * used by UFS and ext2. + */ +struct fuse_fid { + uint16_t len; /* Length of structure. */ + uint16_t pad; /* Force 32-bit alignment. */ + uint32_t gen; /* Generation number. */ + uint64_t nid; /* FUSE node id. */ +}; + #define VTOFUD(vp) \ ((struct fuse_vnode_data *)((vp)->v_data)) #define VTOI(vp) (VTOFUD(vp)->nid) @@ -119,6 +134,12 @@ fuse_vnode_clear_attr_cache(struct vnode *vp) bintime_clear(&VTOFUD(vp)->attr_cache_timeout); } +static uint32_t inline +fuse_vnode_hash(uint64_t id) +{ + return (fnv_32_buf(&id, sizeof(id), FNV1_32_INIT)); +} + #define VTOILLU(vp) ((uint64_t)(VTOFUD(vp) ? VTOI(vp) : 0)) #define FUSE_NULL_ID 0 @@ -126,12 +147,15 @@ fuse_vnode_clear_attr_cache(struct vnode *vp) extern struct vop_vector fuse_fifoops; extern struct vop_vector fuse_vnops; +int fuse_vnode_cmp(struct vnode *vp, void *nidp); + static inline void fuse_vnode_setparent(struct vnode *vp, struct vnode *dvp) { if (dvp != NULL && vp->v_type == VDIR) { MPASS(dvp->v_type == VDIR); VTOFUD(vp)->parent_nid = VTOI(dvp); + VTOFUD(vp)->flag |= FN_PARENT_NID; } } Modified: projects/fuse2/sys/fs/fuse/fuse_vfsops.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_vfsops.c Thu May 23 00:22:03 2019 (r348134) +++ projects/fuse2/sys/fs/fuse/fuse_vfsops.c Thu May 23 00:44:01 2019 (r348135) @@ -107,16 +107,20 @@ SDT_PROBE_DEFINE2(fusefs, , vfsops, trace, "int", "cha #define PRIV_VFS_FUSE_SYNC_UNMOUNT PRIV_VFS_MOUNT_NONUSER #endif +static vfs_fhtovp_t fuse_vfsop_fhtovp; static vfs_mount_t fuse_vfsop_mount; static vfs_unmount_t fuse_vfsop_unmount; static vfs_root_t fuse_vfsop_root; static vfs_statfs_t fuse_vfsop_statfs; +static vfs_vget_t fuse_vfsop_vget; struct vfsops fuse_vfsops = { + .vfs_fhtovp = fuse_vfsop_fhtovp, .vfs_mount = fuse_vfsop_mount, .vfs_unmount = fuse_vfsop_unmount, .vfs_root = fuse_vfsop_root, .vfs_statfs = fuse_vfsop_statfs, + .vfs_vget = fuse_vfsop_vget, }; static int fuse_enforce_dev_perms = 0; @@ -257,6 +261,34 @@ out: } static int +fuse_vfsop_fhtovp(struct mount *mp, struct fid *fhp, int flags, + struct vnode **vpp) +{ + struct fuse_fid *ffhp = (struct fuse_fid *)fhp; + struct fuse_vnode_data *fvdat; + struct vnode *nvp; + int error; + + if (!(fuse_get_mpdata(mp)->dataflags & FSESS_EXPORT_SUPPORT)) + return EOPNOTSUPP; + + error = VFS_VGET(mp, ffhp->nid, LK_EXCLUSIVE, &nvp); + if (error) { + *vpp = NULLVP; + return (error); + } + fvdat = VTOFUD(nvp); + if (fvdat->generation != ffhp->gen ) { + vput(nvp); + *vpp = NULLVP; + return (ESTALE); + } + *vpp = nvp; + vnode_create_vobject(*vpp, 0, curthread); + return (0); +} + +static int fuse_vfsop_mount(struct mount *mp) { int err; @@ -322,7 +354,6 @@ fuse_vfsop_mount(struct mount *mp) SDT_PROBE1(fusefs, , vfsops, mntopts, mntopts); if (mp->mnt_flag & MNT_UPDATE) { - /*dev_rel(fdev);*/ return fuse_vfs_remount(mp, td, mntopts, max_read, daemon_timeout); } @@ -352,7 +383,8 @@ fuse_vfsop_mount(struct mount *mp) td->td_fpop = fptmp; fdrop(fp, td); FUSE_LOCK(); - if (err != 0 || data == NULL || data->mp != NULL) { + + if (err != 0 || data == NULL) { err = ENXIO; SDT_PROBE4(fusefs, , vfsops, mount_err, "invalid or not opened device", data, mp, err); @@ -480,12 +512,82 @@ alreadydead: MNT_ILOCK(mp); mp->mnt_data = NULL; - mp->mnt_flag &= ~MNT_LOCAL; MNT_IUNLOCK(mp); dev_rel(fdev); return 0; +} + +static int +fuse_vfsop_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp) +{ + uint64_t nodeid = ino; + struct thread *td = curthread; + struct fuse_dispatcher fdi; + struct fuse_entry_out *feo; + struct fuse_vnode_data *fvdat; + const char dot[] = "."; + off_t filesize; + enum vtype vtyp; + int error; + + /* + * TODO Check the vnode cache, verifying entry cache timeout. Normally + * done during VOP_LOOKUP + */ + /*error = vfs_hash_get(mp, fuse_vnode_hash(nodeid), LK_EXCLUSIVE, td, vpp,*/ + /*fuse_vnode_cmp, &nodeid);*/ + /*if (error || *vpp != NULL)*/ + /*return error;*/ + + /* Do a LOOKUP, using nodeid as the parent and "." as filename */ + fdisp_init(&fdi, sizeof(dot)); + fdisp_make(&fdi, FUSE_LOOKUP, mp, nodeid, td, td->td_ucred); + memcpy(fdi.indata, dot, sizeof(dot)); + error = fdisp_wait_answ(&fdi); + + if (error) + return error; + + feo = (struct fuse_entry_out *)fdi.answ; + if (feo->nodeid == 0) { + /* zero nodeid means ENOENT and cache it */ + error = ENOENT; + goto out; + } + + vtyp = IFTOVT(feo->attr.mode); + error = fuse_vnode_get(mp, feo, nodeid, NULL, vpp, NULL, vtyp); + if (error) + goto out; + filesize = feo->attr.size; + + /* + * In the case where we are looking up a FUSE node represented by an + * existing cached vnode, and the true size reported by FUSE_LOOKUP + * doesn't match the vnode's cached size, then any cached writes beyond + * the file's current size are lost. + * + * We can get here: + * * following attribute cache expiration, or + * * due a bug in the daemon, or + */ + fvdat = VTOFUD(*vpp); + if (vnode_isreg(*vpp) && + filesize != fvdat->cached_attrs.va_size && + fvdat->flag & FN_SIZECHANGE) { + printf("%s: WB cache incoherent on %s!\n", __func__, + vnode_mount(*vpp)->mnt_stat.f_mntonname); + + fvdat->flag &= ~FN_SIZECHANGE; + } + + fuse_internal_cache_attrs(*vpp, td->td_ucred, &feo->attr, + feo->attr_valid, feo->attr_valid_nsec, NULL); +out: + fdisp_destroy(&fdi); + return error; } static int Modified: projects/fuse2/sys/fs/fuse/fuse_vnops.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_vnops.c Thu May 23 00:22:03 2019 (r348134) +++ projects/fuse2/sys/fs/fuse/fuse_vnops.c Thu May 23 00:44:01 2019 (r348135) @@ -151,6 +151,7 @@ static vop_write_t fuse_vnop_write; static vop_getpages_t fuse_vnop_getpages; static vop_putpages_t fuse_vnop_putpages; static vop_print_t fuse_vnop_print; +static vop_vptofh_t fuse_vnop_vptofh; struct vop_vector fuse_fifoops = { .vop_default = &fifo_specops, @@ -165,6 +166,7 @@ struct vop_vector fuse_fifoops = { .vop_reclaim = fuse_vnop_reclaim, .vop_setattr = fuse_vnop_setattr, .vop_write = VOP_PANIC, + .vop_vptofh = fuse_vnop_vptofh, }; struct vop_vector fuse_vnops = { @@ -202,6 +204,7 @@ struct vop_vector fuse_vnops = { .vop_getpages = fuse_vnop_getpages, .vop_putpages = fuse_vnop_putpages, .vop_print = fuse_vnop_print, + .vop_vptofh = fuse_vnop_vptofh, }; static u_long fuse_lookup_cache_hits = 0; @@ -908,6 +911,8 @@ fuse_vnop_lookup(struct vop_lookup_args *ap) return err; if (flags & ISDOTDOT) { + KASSERT(VTOFUD(dvp)->flag & FN_PARENT_NID, + ("Looking up .. is TODO")); nid = VTOFUD(dvp)->parent_nid; if (nid == 0) return ENOENT; @@ -970,8 +975,8 @@ fuse_vnop_lookup(struct vop_lookup_args *ap) if (!lookup_err) { /* lookup call succeeded */ - nid = ((struct fuse_entry_out *)fdi.answ)->nodeid; feo = (struct fuse_entry_out *)fdi.answ; + nid = feo->nodeid; if (nid == 0) { /* zero nodeid means ENOENT and cache it */ struct timespec timeout; @@ -2446,3 +2451,48 @@ fuse_vnop_print(struct vop_print_args *ap) return 0; } + +/* + * Get an NFS filehandle for a FUSE file. + * + * This will only work for FUSE file systems that guarantee the uniqueness of + * nodeid:generation, which most don't + */ +/* +vop_vptofh { + IN struct vnode *a_vp; + IN struct fid *a_fhp; +}; +*/ +static int +fuse_vnop_vptofh(struct vop_vptofh_args *ap) +{ + struct vnode *vp = ap->a_vp; + struct fuse_vnode_data *fvdat = VTOFUD(vp); + struct fuse_fid *fhp = (struct fuse_fid *)(ap->a_fhp); + _Static_assert(sizeof(struct fuse_fid) <= sizeof(struct fid), + "FUSE fid type is too big"); + struct mount *mp = vnode_mount(vp); + struct fuse_data *data = fuse_get_mpdata(mp); + struct vattr va; + int err; + + if (!(data->dataflags & FSESS_EXPORT_SUPPORT)) + return EOPNOTSUPP; + + err = fuse_internal_getattr(vp, &va, curthread->td_ucred, curthread); + if (err) + return err; + + /*ip = VTOI(ap->a_vp);*/ + /*ufhp = (struct ufid *)ap->a_fhp;*/ + fhp->len = sizeof(struct fuse_fid); + fhp->nid = fvdat->nid; + if (fvdat->generation <= UINT32_MAX) + fhp->gen = fvdat->generation; + else + return EOVERFLOW; + return (0); +} + + Modified: projects/fuse2/tests/sys/fs/fusefs/Makefile ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/Makefile Thu May 23 00:22:03 2019 (r348134) +++ projects/fuse2/tests/sys/fs/fusefs/Makefile Thu May 23 00:44:01 2019 (r348135) @@ -26,6 +26,7 @@ GTESTS+= lookup GTESTS+= mkdir GTESTS+= mknod GTESTS+= mount +GTESTS+= nfs GTESTS+= open GTESTS+= opendir GTESTS+= read @@ -52,6 +53,7 @@ SRCS.$p+= utils.cc TEST_METADATA.default_permissions+= required_user="unprivileged" TEST_METADATA.default_permissions_privileged+= required_user="root" TEST_METADATA.mknod+= required_user="root" +TEST_METADATA.nfs+= required_user="root" # TODO: drastically increase timeout after test development is mostly complete TEST_METADATA+= timeout=10 Added: projects/fuse2/tests/sys/fs/fusefs/nfs.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/fuse2/tests/sys/fs/fusefs/nfs.cc Thu May 23 00:44:01 2019 (r348135) @@ -0,0 +1,307 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by BFF Storage Systems, LLC under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* This file tests functionality needed by NFS servers */ +extern "C" { +#include +#include + +#include +#include +#include +} + +#include "mockfs.hh" +#include "utils.hh" + +using namespace std; +using namespace testing; + + +class Nfs: public FuseTest { +public: +virtual void SetUp() { + if (geteuid() != 0) + GTEST_SKIP() << "This test requires a privileged user"; + FuseTest::SetUp(); +} +}; + +class Exportable: public Nfs { +public: +virtual void SetUp() { + m_init_flags = FUSE_EXPORT_SUPPORT; + Nfs::SetUp(); +} +}; + +class Fhstat: public Exportable {}; +class FhstatNotExportable: public Nfs {}; +class Getfh: public Exportable {}; +class Readdir: public Exportable {}; + +/* If the server returns a different generation number, then file is stale */ +TEST_F(Fhstat, estale) +{ + const char FULLPATH[] = "mountpoint/some_dir/."; + const char RELDIRPATH[] = "some_dir"; + fhandle_t fhp; + struct stat sb; + const uint64_t ino = 42; + const mode_t mode = S_IFDIR | 0755; + Sequence seq; + + EXPECT_LOOKUP(1, RELDIRPATH) + .InSequence(seq) + .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto out) { + SET_OUT_HEADER_LEN(out, entry); + out->body.entry.attr.mode = mode; + out->body.entry.nodeid = ino; + out->body.entry.generation = 1; + out->body.entry.attr_valid = UINT64_MAX; + out->body.entry.entry_valid = 0; + }))); + + EXPECT_LOOKUP(ino, ".") + .InSequence(seq) + .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto out) { + SET_OUT_HEADER_LEN(out, entry); + out->body.entry.attr.mode = mode; + out->body.entry.nodeid = ino; + out->body.entry.generation = 2; + out->body.entry.attr_valid = UINT64_MAX; + out->body.entry.entry_valid = 0; + }))); + + ASSERT_EQ(0, getfh(FULLPATH, &fhp)) << strerror(errno); + ASSERT_EQ(-1, fhstat(&fhp, &sb)); + EXPECT_EQ(ESTALE, errno); +} + +/* If we must lookup an entry from the server, send a LOOKUP request for "." */ +TEST_F(Fhstat, lookup_dot) +{ + const char FULLPATH[] = "mountpoint/some_dir/."; + const char RELDIRPATH[] = "some_dir"; + fhandle_t fhp; + struct stat sb; + const uint64_t ino = 42; + const mode_t mode = S_IFDIR | 0755; + const uid_t uid = 12345; + + EXPECT_LOOKUP(1, RELDIRPATH) + .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto out) { + SET_OUT_HEADER_LEN(out, entry); + out->body.entry.attr.mode = mode; + out->body.entry.nodeid = ino; + out->body.entry.generation = 1; + out->body.entry.attr.uid = uid; + out->body.entry.attr_valid = UINT64_MAX; + out->body.entry.entry_valid = 0; + }))); + + EXPECT_LOOKUP(ino, ".") + .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto out) { + SET_OUT_HEADER_LEN(out, entry); + out->body.entry.attr.mode = mode; + out->body.entry.nodeid = ino; + out->body.entry.generation = 1; + out->body.entry.attr.uid = uid; + out->body.entry.attr_valid = UINT64_MAX; + out->body.entry.entry_valid = 0; + }))); + + ASSERT_EQ(0, getfh(FULLPATH, &fhp)) << strerror(errno); + ASSERT_EQ(0, fhstat(&fhp, &sb)) << strerror(errno); + EXPECT_EQ(uid, sb.st_uid); + EXPECT_EQ(mode, sb.st_mode); +} + +/* Use a file handle whose entry is still cached */ +/* + * Disabled because fuse_vfsop_vget doesn't yet check the entry cache. No PR + * because that's a feature request, not a bug + */ +TEST_F(Fhstat, DISABLED_cached) +{ + const char FULLPATH[] = "mountpoint/some_dir/."; + const char RELDIRPATH[] = "some_dir"; + fhandle_t fhp; + struct stat sb; + const uint64_t ino = 42; + const mode_t mode = S_IFDIR | 0755; + const uid_t uid = 12345; + + EXPECT_LOOKUP(1, RELDIRPATH) + .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto out) { + SET_OUT_HEADER_LEN(out, entry); + out->body.entry.attr.mode = mode; + out->body.entry.nodeid = ino; + out->body.entry.generation = 1; + out->body.entry.attr.uid = uid; + out->body.entry.attr_valid = UINT64_MAX; + out->body.entry.entry_valid = UINT64_MAX; + }))); + + ASSERT_EQ(0, getfh(FULLPATH, &fhp)) << strerror(errno); + ASSERT_EQ(0, fhstat(&fhp, &sb)) << strerror(errno); + EXPECT_EQ(uid, sb.st_uid); + EXPECT_EQ(mode, sb.st_mode); +} + +/* + * If the server doesn't set FUSE_EXPORT_SUPPORT, then we can't do NFS-style + * lookups + */ +TEST_F(FhstatNotExportable, lookup_dot) +{ + const char FULLPATH[] = "mountpoint/some_dir/."; + const char RELDIRPATH[] = "some_dir"; + fhandle_t fhp; + const uint64_t ino = 42; + const mode_t mode = S_IFDIR | 0755; + + EXPECT_LOOKUP(1, RELDIRPATH) + .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto out) { + SET_OUT_HEADER_LEN(out, entry); + out->body.entry.attr.mode = mode; + out->body.entry.nodeid = ino; + out->body.entry.generation = 1; + out->body.entry.attr_valid = UINT64_MAX; + out->body.entry.entry_valid = 0; + }))); + + ASSERT_EQ(-1, getfh(FULLPATH, &fhp)); + ASSERT_EQ(EOPNOTSUPP, errno); +} + +/* FreeBSD's fid struct doesn't have enough space for 64-bit generations */ +TEST_F(Getfh, eoverflow) +{ + const char FULLPATH[] = "mountpoint/some_dir/."; + const char RELDIRPATH[] = "some_dir"; + fhandle_t fhp; + uint64_t ino = 42; + + EXPECT_LOOKUP(1, RELDIRPATH) + .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto out) { + SET_OUT_HEADER_LEN(out, entry); + out->body.entry.attr.mode = S_IFDIR | 0755; + out->body.entry.nodeid = ino; + out->body.entry.generation = (uint64_t)UINT32_MAX + 1; + out->body.entry.attr_valid = UINT64_MAX; + out->body.entry.entry_valid = UINT64_MAX; + }))); + + ASSERT_NE(0, getfh(FULLPATH, &fhp)); + EXPECT_EQ(EOVERFLOW, errno); +} + +/* Get an NFS file handle */ +TEST_F(Getfh, ok) +{ + const char FULLPATH[] = "mountpoint/some_dir/."; + const char RELDIRPATH[] = "some_dir"; + fhandle_t fhp; + uint64_t ino = 42; + + EXPECT_LOOKUP(1, RELDIRPATH) + .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto out) { + SET_OUT_HEADER_LEN(out, entry); + out->body.entry.attr.mode = S_IFDIR | 0755; + out->body.entry.nodeid = ino; + out->body.entry.attr_valid = UINT64_MAX; + out->body.entry.entry_valid = UINT64_MAX; + }))); + + ASSERT_EQ(0, getfh(FULLPATH, &fhp)) << strerror(errno); +} + +/* + * Call readdir via a file handle. + * + * This is how a userspace nfs server like nfs-ganesha or unfs3 would call + * readdir. The in-kernel NFS server never does any equivalent of open. I + * haven't discovered a way to mimic nfsd's behavior short of actually running + * nfsd. + */ +TEST_F(Readdir, getdirentries) +{ + const char FULLPATH[] = "mountpoint/some_dir"; + const char RELPATH[] = "some_dir"; + uint64_t ino = 42; + mode_t mode = S_IFDIR | 0755; + fhandle_t fhp; + int fd; + char buf[8192]; + ssize_t r; + + EXPECT_LOOKUP(1, RELPATH) + .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto out) { + SET_OUT_HEADER_LEN(out, entry); + out->body.entry.attr.mode = mode; + out->body.entry.nodeid = ino; + out->body.entry.generation = 1; + out->body.entry.attr_valid = UINT64_MAX; + out->body.entry.entry_valid = 0; + }))); + + EXPECT_LOOKUP(ino, ".") + .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto out) { + SET_OUT_HEADER_LEN(out, entry); + out->body.entry.attr.mode = mode; + out->body.entry.nodeid = ino; + out->body.entry.generation = 1; + out->body.entry.attr_valid = UINT64_MAX; + out->body.entry.entry_valid = 0; + }))); + + expect_opendir(ino); + + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in->header.opcode == FUSE_READDIR && + in->header.nodeid == ino && + in->body.readdir.size == sizeof(buf)); + }, Eq(true)), + _) + ).WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto out) { + out->header.error = 0; + out->header.len = sizeof(out->header); + }))); + + ASSERT_EQ(0, getfh(FULLPATH, &fhp)) << strerror(errno); + fd = fhopen(&fhp, O_DIRECTORY); + ASSERT_LE(0, fd) << strerror(errno); + r = getdirentries(fd, buf, sizeof(buf), 0); + ASSERT_EQ(0, r) << strerror(errno); + + /* Deliberately leak fd. RELEASEDIR will be tested separately */ +} Modified: projects/fuse2/tests/sys/fs/fusefs/readdir.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/readdir.cc Thu May 23 00:22:03 2019 (r348134) +++ projects/fuse2/tests/sys/fs/fusefs/readdir.cc Thu May 23 00:44:01 2019 (r348135) @@ -45,56 +45,6 @@ void expect_lookup(const char *relpath, uint64_t ino) { FuseTest::expect_lookup(relpath, ino, S_IFDIR | 0755, 0, 1); } - -void expect_readdir(uint64_t ino, uint64_t off, vector &ents) -{ - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - return (in->header.opcode == FUSE_READDIR && - in->header.nodeid == ino && - in->body.readdir.fh == FH && - in->body.readdir.offset == off); - }, Eq(true)), - _) - ).WillRepeatedly(Invoke(ReturnImmediate([=](auto in, auto out) { - struct fuse_dirent *fde = (struct fuse_dirent*)out->body.bytes; - int i = 0; - - out->header.error = 0; - out->header.len = 0; - - for (const auto& it: ents) { - size_t entlen, entsize; - - fde->ino = it.d_fileno; - fde->off = it.d_off; - fde->type = it.d_type; - fde->namelen = it.d_namlen; - strncpy(fde->name, it.d_name, it.d_namlen); - entlen = FUSE_NAME_OFFSET + fde->namelen; - entsize = FUSE_DIRENT_SIZE(fde); - /* - * The FUSE protocol does not require zeroing out the - * unused portion of the name. But it's a good - * practice to prevent information disclosure to the - * FUSE client, even though the client is usually the - * kernel - */ - memset(fde->name + fde->namelen, 0, entsize - entlen); - if (out->header.len + entsize > in->body.read.size) { - printf("Overflow in readdir expectation: i=%d\n" - , i); - break; - } - out->header.len += entsize; - fde = (struct fuse_dirent*) - ((long*)fde + entsize / sizeof(long)); - i++; - } - out->header.len += sizeof(out->header); - }))); - -} }; class Readdir_7_8: public Readdir { Modified: projects/fuse2/tests/sys/fs/fusefs/utils.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/utils.cc Thu May 23 00:22:03 2019 (r348134) +++ projects/fuse2/tests/sys/fs/fusefs/utils.cc Thu May 23 00:44:01 2019 (r348135) @@ -35,6 +35,7 @@ extern "C" { #include #include +#include #include #include #include @@ -285,6 +286,56 @@ void FuseTest::expect_read(uint64_t ino, uint64_t offs }))).RetiresOnSaturation(); } +void FuseTest::expect_readdir(uint64_t ino, uint64_t off, + std::vector &ents) +{ + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in->header.opcode == FUSE_READDIR && + in->header.nodeid == ino && + in->body.readdir.fh == FH && + in->body.readdir.offset == off); + }, Eq(true)), + _) + ).WillRepeatedly(Invoke(ReturnImmediate([=](auto in, auto out) { + struct fuse_dirent *fde = (struct fuse_dirent*)out->body.bytes; + int i = 0; + + out->header.error = 0; + out->header.len = 0; + + for (const auto& it: ents) { + size_t entlen, entsize; + + fde->ino = it.d_fileno; + fde->off = it.d_off; + fde->type = it.d_type; + fde->namelen = it.d_namlen; + strncpy(fde->name, it.d_name, it.d_namlen); + entlen = FUSE_NAME_OFFSET + fde->namelen; + entsize = FUSE_DIRENT_SIZE(fde); + /* + * The FUSE protocol does not require zeroing out the + * unused portion of the name. But it's a good + * practice to prevent information disclosure to the + * FUSE client, even though the client is usually the + * kernel + */ + memset(fde->name + fde->namelen, 0, entsize - entlen); + if (out->header.len + entsize > in->body.read.size) { + printf("Overflow in readdir expectation: i=%d\n" + , i); + break; + } + out->header.len += entsize; + fde = (struct fuse_dirent*) + ((long*)fde + entsize / sizeof(long)); + i++; + } + out->header.len += sizeof(out->header); + }))); + +} void FuseTest::expect_release(uint64_t ino, uint64_t fh) { EXPECT_CALL(*m_mock, process( Modified: projects/fuse2/tests/sys/fs/fusefs/utils.hh ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/utils.hh Thu May 23 00:22:03 2019 (r348134) +++ projects/fuse2/tests/sys/fs/fusefs/utils.hh Thu May 23 00:44:01 2019 (r348135) @@ -150,6 +150,14 @@ class FuseTest : public ::testing::Test { void expect_read(uint64_t ino, uint64_t offset, uint64_t isize, uint64_t osize, const void *contents); + /* + * Create an expectation that FUSE_READIR will be called any number of + * times on the given ino with the given offset, returning (by copy) + * the provided entries + */ + void expect_readdir(uint64_t ino, uint64_t off, + std::vector &ents); + /* * Create an expectation that FUSE_RELEASE will be called exactly once * for the given inode and filehandle, returning success From owner-svn-src-projects@freebsd.org Thu May 23 01:48:09 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFE3D15945BD for ; Thu, 23 May 2019 01:48:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91564753FC; Thu, 23 May 2019 01:48:08 +0000 (UTC) (envelope-from ngie@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65E0625F94; Thu, 23 May 2019 01:48:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4N1m8fG036709; Thu, 23 May 2019 01:48:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4N1m8ve036707; Thu, 23 May 2019 01:48:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905230148.x4N1m8ve036707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Thu, 23 May 2019 01:48:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r348142 - projects/runtime-coverage-v2/share/mk X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: projects/runtime-coverage-v2/share/mk X-SVN-Commit-Revision: 348142 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 91564753FC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 01:48:09 -0000 Author: ngie Date: Thu May 23 01:48:07 2019 New Revision: 348142 URL: https://svnweb.freebsd.org/changeset/base/348142 Log: Ensure that coverage-capable linkers only include lld right now Modified: projects/runtime-coverage-v2/share/mk/bsd.lib.mk projects/runtime-coverage-v2/share/mk/bsd.prog.mk Modified: projects/runtime-coverage-v2/share/mk/bsd.lib.mk ============================================================================== --- projects/runtime-coverage-v2/share/mk/bsd.lib.mk Thu May 23 01:41:49 2019 (r348141) +++ projects/runtime-coverage-v2/share/mk/bsd.lib.mk Thu May 23 01:48:07 2019 (r348142) @@ -9,7 +9,7 @@ # This forces coverage off if the compiler/linker isn't capable, as src.opts.mk # is not always used in time. .if !${COMPILER_FEATURES:Mcoverage} && \ - (${LINKER_TYPE} == "lld" && !${LINKER_FEATURES:Mdwarfv4}) + ${LINKER_TYPE} != "lld" || !${LINKER_FEATURES:Mdwarfv4} MK_COVERAGE:= no .endif Modified: projects/runtime-coverage-v2/share/mk/bsd.prog.mk ============================================================================== --- projects/runtime-coverage-v2/share/mk/bsd.prog.mk Thu May 23 01:41:49 2019 (r348141) +++ projects/runtime-coverage-v2/share/mk/bsd.prog.mk Thu May 23 01:48:07 2019 (r348142) @@ -7,8 +7,8 @@ # This forces coverage off if the compiler/linker isn't capable, as src.opts.mk # is not always used in time. -.if !${COMPILER_FEATURES:Mcoverage} && \ - (${LINKER_TYPE} == "lld" && !${LINKER_FEATURES:Mdwarfv4}) +.if !${COMPILER_FEATURES:Mcoverage} || \ + ${LINKER_TYPE} != "lld" || !${LINKER_FEATURES:Mdwarfv4} MK_COVERAGE:= no .endif From owner-svn-src-projects@freebsd.org Thu May 23 22:57:58 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA6F415B89A0 for ; Thu, 23 May 2019 22:57:58 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 811C68E4DE; Thu, 23 May 2019 22:57:58 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59D48BFAF; Thu, 23 May 2019 22:57:58 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NMvwZF014234; Thu, 23 May 2019 22:57:58 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NMvwfM014233; Thu, 23 May 2019 22:57:58 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905232257.x4NMvwfM014233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 23 May 2019 22:57:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r348208 - projects/fuse2/sys/fs/fuse X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: projects/fuse2/sys/fs/fuse X-SVN-Commit-Revision: 348208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 811C68E4DE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 22:57:59 -0000 Author: asomers Date: Thu May 23 22:57:57 2019 New Revision: 348208 URL: https://svnweb.freebsd.org/changeset/base/348208 Log: fusefs: assume the mountpoint's generation is 0 This seems to be libfuse's behavior (its documentation notwithstanding). Sponsored by: The FreeBSD Foundation Modified: projects/fuse2/sys/fs/fuse/fuse_node.c Modified: projects/fuse2/sys/fs/fuse/fuse_node.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_node.c Thu May 23 22:49:03 2019 (r348207) +++ projects/fuse2/sys/fs/fuse/fuse_node.c Thu May 23 22:57:57 2019 (r348208) @@ -263,7 +263,11 @@ fuse_vnode_get(struct mount *mp, enum vtype vtyp) { struct thread *td = (cnp != NULL ? cnp->cn_thread : curthread); - uint64_t generation = feo ? feo->generation : 1; + /* + * feo should only be NULL for the root directory, which (when libfuse + * is used) always has generation 0 + */ + uint64_t generation = feo ? feo->generation : 0; int err = 0; err = fuse_vnode_alloc(mp, td, nodeid, vtyp, vpp); From owner-svn-src-projects@freebsd.org Thu May 23 23:06:28 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A389B15B8BAE for ; Thu, 23 May 2019 23:06:28 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22E008E9B9; Thu, 23 May 2019 23:06:28 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3AB6C152; Thu, 23 May 2019 23:06:27 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NN6RsO019307; Thu, 23 May 2019 23:06:27 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NN6QeN019302; Thu, 23 May 2019 23:06:26 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905232306.x4NN6QeN019302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 23 May 2019 23:06:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r348209 - projects/fuse2/sys/fs/fuse X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: projects/fuse2/sys/fs/fuse X-SVN-Commit-Revision: 348209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 22E008E9B9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 23:06:28 -0000 Author: asomers Date: Thu May 23 23:06:26 2019 New Revision: 348209 URL: https://svnweb.freebsd.org/changeset/base/348209 Log: fusefs: fix exporting fuse filesystems with nfsd A previous commit made fuse exportable via userland NFS servers. Compatibility with the in-kernel nfsd required two more changes: * During read and write operations, implicitly do a FUSE_OPEN if there isn't already a valid file handle. That's because nfsd never calls VOP_OPEN. * During VOP_READDIR, if an implicit open was necessary, directory offsets from a previous VOP_READDIR may not be valid, so VOP_READDIR may have to start from the beginning and read until it encounters the requested offset. I've done only limited testing over NFS, so there are probably still some more bugs. Thanks to rmacklem for all of the readdir changes, which he had made for his pnfs work. Sponsored by: The FreeBSD Foundation Modified: projects/fuse2/sys/fs/fuse/fuse_file.c projects/fuse2/sys/fs/fuse/fuse_internal.c projects/fuse2/sys/fs/fuse/fuse_internal.h projects/fuse2/sys/fs/fuse/fuse_io.c projects/fuse2/sys/fs/fuse/fuse_vnops.c Modified: projects/fuse2/sys/fs/fuse/fuse_file.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_file.c Thu May 23 22:57:57 2019 (r348208) +++ projects/fuse2/sys/fs/fuse/fuse_file.c Thu May 23 23:06:26 2019 (r348209) @@ -286,6 +286,7 @@ fuse_filehandle_get(struct vnode *vp, int fflag, fufh_type_t fufh_type; fufh_type = fflags_2_fufh_type(fflag); + /* cred can be NULL for in-kernel clients */ if (cred == NULL) goto fallback; Modified: projects/fuse2/sys/fs/fuse/fuse_internal.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_internal.c Thu May 23 22:57:57 2019 (r348208) +++ projects/fuse2/sys/fs/fuse/fuse_internal.c Thu May 23 23:06:26 2019 (r348209) @@ -344,16 +344,19 @@ fuse_internal_mknod(struct vnode *dvp, struct vnode ** int fuse_internal_readdir(struct vnode *vp, struct uio *uio, + off_t startoff, struct fuse_filehandle *fufh, - struct fuse_iov *cookediov) + struct fuse_iov *cookediov, + int *ncookies, + u_long *cookies) { int err = 0; struct fuse_dispatcher fdi; struct fuse_read_in *fri = NULL; + int fnd_start; - if (uio_resid(uio) == 0) { + if (uio_resid(uio) == 0) return 0; - } fdisp_init(&fdi, 0); /* @@ -361,6 +364,17 @@ fuse_internal_readdir(struct vnode *vp, * I/O). */ + /* + * fnd_start is set non-zero once the offset in the directory gets + * to the startoff. This is done because directories must be read + * from the beginning (offset == 0) when fuse_vnop_readdir() needs + * to do an open of the directory. + * If it is not set non-zero here, it will be set non-zero in + * fuse_internal_readdir_processdata() when uio_offset == startoff. + */ + fnd_start = 0; + if (uio->uio_offset == startoff) + fnd_start = 1; while (uio_resid(uio) > 0) { fdi.iosize = sizeof(*fri); if (fri == NULL) @@ -374,40 +388,46 @@ fuse_internal_readdir(struct vnode *vp, fri->size = MIN(uio->uio_resid, fuse_get_mpdata(vp->v_mount)->max_read); - if ((err = fdisp_wait_answ(&fdi))) { + if ((err = fdisp_wait_answ(&fdi))) break; - } - if ((err = fuse_internal_readdir_processdata(uio, fri->size, fdi.answ, - fdi.iosize, cookediov))) { + if ((err = fuse_internal_readdir_processdata(uio, startoff, + &fnd_start, fri->size, fdi.answ, fdi.iosize, cookediov, + ncookies, &cookies))) break; - } } fdisp_destroy(&fdi); return ((err == -1) ? 0 : err); } +/* + * Return -1 to indicate that this readdir is finished, 0 if it copied + * all the directory data read in and it may be possible to read more + * and greater than 0 for a failure. + */ int fuse_internal_readdir_processdata(struct uio *uio, + off_t startoff, + int *fnd_start, size_t reqsize, void *buf, size_t bufsize, - void *param) + struct fuse_iov *cookediov, + int *ncookies, + u_long **cookiesp) { int err = 0; - int cou = 0; int bytesavail; size_t freclen; struct dirent *de; struct fuse_dirent *fudge; - struct fuse_iov *cookediov = param; + u_long *cookies; - if (bufsize < FUSE_NAME_OFFSET) { + cookies = *cookiesp; + if (bufsize < FUSE_NAME_OFFSET) return -1; - } for (;;) { - if (bufsize < FUSE_NAME_OFFSET) { err = -1; break; @@ -415,10 +435,12 @@ fuse_internal_readdir_processdata(struct uio *uio, fudge = (struct fuse_dirent *)buf; freclen = FUSE_DIRENT_SIZE(fudge); - cou++; - if (bufsize < freclen) { - err = ((cou == 1) ? -1 : 0); + /* + * This indicates a partial directory entry at the + * end of the directory data. + */ + err = -1; break; } #ifdef ZERO_PAD_INCOMPLETE_BUFS @@ -436,30 +458,48 @@ fuse_internal_readdir_processdata(struct uio *uio, &fudge->namelen); if (bytesavail > uio_resid(uio)) { + /* Out of space for the dir so we are done. */ err = -1; break; } - fiov_adjust(cookediov, bytesavail); - bzero(cookediov->base, bytesavail); + /* + * Don't start to copy the directory entries out until + * the requested offset in the directory is found. + */ + if (*fnd_start != 0) { + readany = true; + fiov_adjust(cookediov, bytesavail); + bzero(cookediov->base, bytesavail); - de = (struct dirent *)cookediov->base; - de->d_fileno = fudge->ino; - de->d_reclen = bytesavail; - de->d_type = fudge->type; - de->d_namlen = fudge->namelen; - memcpy((char *)cookediov->base + sizeof(struct dirent) - - MAXNAMLEN - 1, - (char *)buf + FUSE_NAME_OFFSET, fudge->namelen); - dirent_terminate(de); + de = (struct dirent *)cookediov->base; + de->d_fileno = fudge->ino; + de->d_reclen = bytesavail; + de->d_type = fudge->type; + de->d_namlen = fudge->namelen; + memcpy((char *)cookediov->base + sizeof(struct dirent) - + MAXNAMLEN - 1, + (char *)buf + FUSE_NAME_OFFSET, fudge->namelen); + dirent_terminate(de); - err = uiomove(cookediov->base, cookediov->len, uio); - if (err) { - break; - } + err = uiomove(cookediov->base, cookediov->len, uio); + if (err) + break; + if (cookies != NULL) { + if (*ncookies == 0) { + err = -1; + break; + } + *cookies = fudge->off; + cookies++; + (*ncookies)--; + } + } else if (startoff == fudge->off) + *fnd_start = 1; buf = (char *)buf + freclen; bufsize -= freclen; uio_setoffset(uio, fudge->off); } + *cookiesp = cookies; return err; } Modified: projects/fuse2/sys/fs/fuse/fuse_internal.h ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_internal.h Thu May 23 22:57:57 2019 (r348208) +++ projects/fuse2/sys/fs/fuse/fuse_internal.h Thu May 23 23:06:26 2019 (r348209) @@ -236,10 +236,12 @@ int fuse_internal_mknod(struct vnode *dvp, struct vnod struct componentname *cnp, struct vattr *vap); /* readdir */ -int fuse_internal_readdir(struct vnode *vp, struct uio *uio, - struct fuse_filehandle *fufh, struct fuse_iov *cookediov); -int fuse_internal_readdir_processdata(struct uio *uio, size_t reqsize, - void *buf, size_t bufsize, void *param); +int fuse_internal_readdir(struct vnode *vp, struct uio *uio, off_t startoff, + struct fuse_filehandle *fufh, struct fuse_iov *cookediov, int *ncookies, + u_long *cookies); +int fuse_internal_readdir_processdata(struct uio *uio, off_t startoff, + int *fnd_start, size_t reqsize, void *buf, size_t bufsize, + struct fuse_iov *cookediov, int *ncookies, u_long **cookiesp); /* remove */ Modified: projects/fuse2/sys/fs/fuse/fuse_io.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_io.c Thu May 23 22:57:57 2019 (r348208) +++ projects/fuse2/sys/fs/fuse/fuse_io.c Thu May 23 23:06:26 2019 (r348209) @@ -170,15 +170,26 @@ fuse_io_dispatch(struct vnode *vp, struct uio *uio, in struct fuse_filehandle *fufh; int err, directio; int fflag; + bool closefufh = false; MPASS(vp->v_type == VREG || vp->v_type == VDIR); fflag = (uio->uio_rw == UIO_READ) ? FREAD : FWRITE; err = fuse_filehandle_getrw(vp, fflag, &fufh, cred, pid); - if (err) { + if (err == EBADF && vnode_mount(vp)->mnt_flag & MNT_EXPORTED) { + /* + * nfsd will do I/O without first doing VOP_OPEN. We + * must implicitly open the file here + */ + err = fuse_filehandle_open(vp, fflag, &fufh, curthread, cred); + closefufh = true; + } + else if (err) { printf("FUSE: io dispatch: filehandles are closed\n"); return err; } + if (err) + goto out; SDT_PROBE5(fusefs, , io, io_dispatch, vp, uio, ioflag, cred, fufh); /* @@ -222,7 +233,7 @@ fuse_io_dispatch(struct vnode *vp, struct uio *uio, in err = fuse_vnode_size(vp, &filesize, cred, curthread); if (err) - return err; + goto out; start = uio->uio_offset; end = start + uio->uio_resid; @@ -246,6 +257,10 @@ fuse_io_dispatch(struct vnode *vp, struct uio *uio, in default: panic("uninterpreted mode passed to fuse_io_dispatch"); } + +out: + if (closefufh) + fuse_filehandle_close(vp, fufh, curthread, cred); return (err); } Modified: projects/fuse2/sys/fs/fuse/fuse_vnops.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_vnops.c Thu May 23 22:57:57 2019 (r348208) +++ projects/fuse2/sys/fs/fuse/fuse_vnops.c Thu May 23 23:06:26 2019 (r348209) @@ -1176,7 +1176,7 @@ fuse_vnop_mknod(struct vop_mknod_args *ap) } /* - struct vnop_open_args { + struct vop_open_args { struct vnode *a_vp; int a_mode; struct ucred *a_cred; @@ -1270,7 +1270,7 @@ fuse_vnop_read(struct vop_read_args *ap) struct uio *a_uio; struct ucred *a_cred; int *a_eofflag; - int *ncookies; + int *a_ncookies; u_long **a_cookies; }; */ @@ -1283,8 +1283,15 @@ fuse_vnop_readdir(struct vop_readdir_args *ap) struct fuse_filehandle *fufh = NULL; struct fuse_iov cookediov; int err = 0; + u_long *cookies; + off_t startoff; + ssize_t tresid; + int ncookies; + bool closefufh = false; pid_t pid = curthread->td_proc->p_pid; + if (ap->a_eofflag) + *ap->a_eofflag = 0; if (fuse_isdeadfs(vp)) { return ENXIO; } @@ -1293,15 +1300,60 @@ fuse_vnop_readdir(struct vop_readdir_args *ap) return EINVAL; } + tresid = uio->uio_resid; + startoff = uio->uio_offset; err = fuse_filehandle_get_dir(vp, &fufh, cred, pid); + if (err == EBADF && vnode_mount(vp)->mnt_flag & MNT_EXPORTED) { + /* + * nfsd will do VOP_READDIR without first doing VOP_OPEN. We + * must implicitly open the directory here + */ + err = fuse_filehandle_open(vp, FREAD, &fufh, curthread, cred); + if (err == 0) { + /* + * When a directory is opened, it must be read from + * the beginning. Hopefully, the "startoff" still + * exists as an offset cookie for the directory. + * If not, it will read the entire directory without + * returning any entries and just return eof. + */ + uio->uio_offset = 0; + } + closefufh = true; + } if (err) return (err); + if (ap->a_ncookies != NULL) { + ncookies = uio->uio_resid / + (offsetof(struct dirent, d_name) + 4) + 1; + cookies = malloc(ncookies * sizeof(*cookies), M_TEMP, M_WAITOK); + *ap->a_ncookies = ncookies; + *ap->a_cookies = cookies; + } else { + ncookies = 0; + cookies = NULL; + } #define DIRCOOKEDSIZE FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + MAXNAMLEN + 1) fiov_init(&cookediov, DIRCOOKEDSIZE); - err = fuse_internal_readdir(vp, uio, fufh, &cookediov); + err = fuse_internal_readdir(vp, uio, startoff, fufh, &cookediov, + &ncookies, cookies); fiov_teardown(&cookediov); + if (closefufh) + fuse_filehandle_close(vp, fufh, curthread, cred); + + if (ap->a_ncookies != NULL) { + if (err == 0) { + *ap->a_ncookies -= ncookies; + } else { + free(*ap->a_cookies, M_TEMP); + *ap->a_ncookies = 0; + *ap->a_cookies = NULL; + } + } + if (err == 0 && tresid == uio->uio_resid) + *ap->a_eofflag = 1; return err; } From owner-svn-src-projects@freebsd.org Fri May 24 00:56:51 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EE831591855 for ; Fri, 24 May 2019 00:56:51 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B81536BFD0; Fri, 24 May 2019 00:56:50 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 930AAD4A1; Fri, 24 May 2019 00:56:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4O0uoiB078162; Fri, 24 May 2019 00:56:50 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O0uogm078161; Fri, 24 May 2019 00:56:50 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905240056.x4O0uogm078161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 24 May 2019 00:56:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r348214 - projects/fuse2/sys/fs/fuse X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: projects/fuse2/sys/fs/fuse X-SVN-Commit-Revision: 348214 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B81536BFD0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 00:56:51 -0000 Author: asomers Date: Fri May 24 00:56:50 2019 New Revision: 348214 URL: https://svnweb.freebsd.org/changeset/base/348214 Log: fusefs: fix some garbage left behind by r348209 Sponsored by: The FreeBSD Foundation Modified: projects/fuse2/sys/fs/fuse/fuse_internal.c Modified: projects/fuse2/sys/fs/fuse/fuse_internal.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_internal.c Fri May 24 00:44:31 2019 (r348213) +++ projects/fuse2/sys/fs/fuse/fuse_internal.c Fri May 24 00:56:50 2019 (r348214) @@ -467,7 +467,6 @@ fuse_internal_readdir_processdata(struct uio *uio, * the requested offset in the directory is found. */ if (*fnd_start != 0) { - readany = true; fiov_adjust(cookediov, bytesavail); bzero(cookediov->base, bytesavail); From owner-svn-src-projects@freebsd.org Fri May 24 05:12:45 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57AE31597F04 for ; Fri, 24 May 2019 05:12:45 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF8C97453D; Fri, 24 May 2019 05:12:44 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB61618247; Fri, 24 May 2019 05:12:44 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4O5CiRW016048; Fri, 24 May 2019 05:12:44 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O5CiFR016044; Fri, 24 May 2019 05:12:44 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905240512.x4O5CiFR016044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 24 May 2019 05:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r348224 - in projects/fuse2: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in projects/fuse2: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Commit-Revision: 348224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EF8C97453D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 05:12:45 -0000 Author: asomers Date: Fri May 24 05:12:43 2019 New Revision: 348224 URL: https://svnweb.freebsd.org/changeset/base/348224 Log: fusefs: implement FUSE_ASYNC_READ If a daemon sets the FUSE_ASYNC_READ flag during initialization, then the client is allowed to issue multiple concurrent reads for the same file handle. Otherwise concurrent reads are not allowed. This commit implements it. Previously we unconditionally disallowed concurrent reads. Sponsored by: The FreeBSD Foundation Modified: projects/fuse2/sys/fs/fuse/fuse_internal.c projects/fuse2/sys/fs/fuse/fuse_ipc.h projects/fuse2/sys/fs/fuse/fuse_node.c projects/fuse2/tests/sys/fs/fusefs/read.cc Modified: projects/fuse2/sys/fs/fuse/fuse_internal.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_internal.c Fri May 24 04:15:38 2019 (r348223) +++ projects/fuse2/sys/fs/fuse/fuse_internal.c Fri May 24 05:12:43 2019 (r348224) @@ -764,6 +764,8 @@ fuse_internal_init_callback(struct fuse_ticket *tick, if (fuse_libabi_geq(data, 7, 5)) { if (fticket_resp(tick)->len == sizeof(struct fuse_init_out)) { data->max_write = fiio->max_write; + if (fiio->flags & FUSE_ASYNC_READ) + data->dataflags |= FSESS_ASYNC_READ; if (fiio->flags & FUSE_POSIX_LOCKS) data->dataflags |= FSESS_POSIX_LOCKS; if (fiio->flags & FUSE_EXPORT_SUPPORT) @@ -805,7 +807,7 @@ fuse_internal_send_init(struct fuse_data *data, struct * the size of a buffer cache block. */ fiii->max_readahead = maxbcachebuf; - fiii->flags = FUSE_EXPORT_SUPPORT | FUSE_POSIX_LOCKS; + fiii->flags = FUSE_ASYNC_READ | FUSE_POSIX_LOCKS | FUSE_EXPORT_SUPPORT ; fuse_insert_callback(fdi.tick, fuse_internal_init_callback); fuse_insert_message(fdi.tick, false); Modified: projects/fuse2/sys/fs/fuse/fuse_ipc.h ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_ipc.h Fri May 24 04:15:38 2019 (r348223) +++ projects/fuse2/sys/fs/fuse/fuse_ipc.h Fri May 24 05:12:43 2019 (r348224) @@ -221,6 +221,7 @@ struct fuse_data { #define FSESS_NO_DATACACHE 0x0200 /* disable buffer cache */ #define FSESS_NO_NAMECACHE 0x0400 /* disable name cache */ #define FSESS_NO_MMAP 0x0800 /* disable mmap */ +#define FSESS_ASYNC_READ 0x1000 /* allow multiple reads of some file */ #define FSESS_POSIX_LOCKS 0x2000 /* daemon supports POSIX locks */ #define FSESS_EXPORT_SUPPORT 0x10000 /* daemon supports NFS-style lookups */ #define FSESS_MNTOPTS_MASK ( \ Modified: projects/fuse2/sys/fs/fuse/fuse_node.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_node.c Fri May 24 04:15:38 2019 (r348223) +++ projects/fuse2/sys/fs/fuse/fuse_node.c Fri May 24 05:12:43 2019 (r348224) @@ -179,10 +179,12 @@ fuse_vnode_alloc(struct mount *mp, enum vtype vtyp, struct vnode **vpp) { + struct fuse_data *data; struct fuse_vnode_data *fvdat; struct vnode *vp2; int err = 0; + data = fuse_get_mpdata(mp); if (vtyp == VNON) { return EINVAL; } @@ -235,6 +237,10 @@ fuse_vnode_alloc(struct mount *mp, *vpp = NULL; return (err); } + /* Disallow async reads for fifos because UFS does. I don't know why */ + if (data->dataflags & FSESS_ASYNC_READ && vtyp != VFIFO) + VN_LOCK_ASHARE(*vpp); + err = vfs_hash_insert(*vpp, fuse_vnode_hash(nodeid), LK_EXCLUSIVE, td, &vp2, fuse_vnode_cmp, &nodeid); if (err) { Modified: projects/fuse2/tests/sys/fs/fusefs/read.cc ============================================================================== --- projects/fuse2/tests/sys/fs/fusefs/read.cc Fri May 24 04:15:38 2019 (r348223) +++ projects/fuse2/tests/sys/fs/fusefs/read.cc Fri May 24 05:12:43 2019 (r348224) @@ -37,6 +37,7 @@ extern "C" { #include #include +#include #include } @@ -159,21 +160,22 @@ TEST_F(AioRead, async_read_disabled) ssize_t bufsize = 50; char buf0[bufsize], buf1[bufsize]; off_t off0 = 0; - off_t off1 = 4096; + off_t off1 = 65536; struct aiocb iocb0, iocb1; + volatile sig_atomic_t read_count = 0; - expect_lookup(RELPATH, ino, bufsize); + expect_lookup(RELPATH, ino, 131072); expect_open(ino, 0, 1); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { return (in->header.opcode == FUSE_READ && in->header.nodeid == ino && in->body.read.fh == FH && - in->body.read.offset == (uint64_t)off0 && - in->body.read.size == bufsize); + in->body.read.offset == (uint64_t)off0); }, Eq(true)), _) - ).WillOnce(Invoke([](auto in __unused, auto &out __unused) { + ).WillRepeatedly(Invoke([&](auto in __unused, auto &out __unused) { + read_count++; /* Filesystem is slow to respond */ })); EXPECT_CALL(*m_mock, process( @@ -181,11 +183,13 @@ TEST_F(AioRead, async_read_disabled) return (in->header.opcode == FUSE_READ && in->header.nodeid == ino && in->body.read.fh == FH && - in->body.read.offset == (uint64_t)off1 && - in->body.read.size == bufsize); + in->body.read.offset == (uint64_t)off1); }, Eq(true)), _) - ).Times(0); + ).WillRepeatedly(Invoke([&](auto in __unused, auto &out __unused) { + read_count++; + /* Filesystem is slow to respond */ + })); fd = open(FULLPATH, O_RDONLY); ASSERT_LE(0, fd) << strerror(errno); @@ -214,8 +218,12 @@ TEST_F(AioRead, async_read_disabled) * the second read, even though the first has not yet returned */ nap(); + EXPECT_EQ(read_count, 1); - /* Deliberately leak iocbs */ + m_mock->kill_daemon(); + /* Wait for AIO activity to complete, but ignore errors */ + (void)aio_waitcomplete(NULL, NULL); + /* Deliberately leak fd. close(2) will be tested in release.cc */ } @@ -223,11 +231,7 @@ TEST_F(AioRead, async_read_disabled) * With the FUSE_ASYNC_READ mount option, fuse(4) may issue multiple * simultaneous read requests on the same file handle. */ -/* - * Disabled because we don't yet implement FUSE_ASYNC_READ. No bugzilla - * entry, because that's a feature request, not a bug. - */ -TEST_F(AsyncRead, DISABLED_async_read) +TEST_F(AsyncRead, async_read) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; @@ -236,21 +240,24 @@ TEST_F(AsyncRead, DISABLED_async_read) ssize_t bufsize = 50; char buf0[bufsize], buf1[bufsize]; off_t off0 = 0; - off_t off1 = 4096; + off_t off1 = 65536; struct aiocb iocb0, iocb1; + sem_t sem; - expect_lookup(RELPATH, ino, bufsize); + ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno); + + expect_lookup(RELPATH, ino, 131072); expect_open(ino, 0, 1); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { return (in->header.opcode == FUSE_READ && in->header.nodeid == ino && in->body.read.fh == FH && - in->body.read.offset == (uint64_t)off0 && - in->body.read.size == bufsize); + in->body.read.offset == (uint64_t)off0); }, Eq(true)), _) - ).WillOnce(Invoke([](auto in __unused, auto &out __unused) { + ).WillOnce(Invoke([&](auto in __unused, auto &out __unused) { + sem_post(&sem); /* Filesystem is slow to respond */ })); EXPECT_CALL(*m_mock, process( @@ -258,11 +265,11 @@ TEST_F(AsyncRead, DISABLED_async_read) return (in->header.opcode == FUSE_READ && in->header.nodeid == ino && in->body.read.fh == FH && - in->body.read.offset == (uint64_t)off1 && - in->body.read.size == bufsize); + in->body.read.offset == (uint64_t)off1); }, Eq(true)), _) - ).WillOnce(Invoke([](auto in __unused, auto &out __unused) { + ).WillOnce(Invoke([&](auto in __unused, auto &out __unused) { + sem_post(&sem); /* Filesystem is slow to respond */ })); @@ -287,13 +294,14 @@ TEST_F(AsyncRead, DISABLED_async_read) iocb1.aio_sigevent.sigev_notify = SIGEV_NONE; ASSERT_EQ(0, aio_read(&iocb1)) << strerror(errno); - /* - * Sleep for awhile to make sure the kernel has had a chance to issue - * both reads. - */ - nap(); + /* Wait until both reads have reached the daemon */ + ASSERT_EQ(0, sem_wait(&sem)) << strerror(errno); + ASSERT_EQ(0, sem_wait(&sem)) << strerror(errno); + + m_mock->kill_daemon(); + /* Wait for AIO activity to complete, but ignore errors */ + (void)aio_waitcomplete(NULL, NULL); - /* Deliberately leak iocbs */ /* Deliberately leak fd. close(2) will be tested in release.cc */ } From owner-svn-src-projects@freebsd.org Sat May 25 21:40:29 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61C5E15B6F64 for ; Sat, 25 May 2019 21:40:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F30D28A5B6; Sat, 25 May 2019 21:40:28 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE79AA19E; Sat, 25 May 2019 21:40:28 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4PLeSvC009067; Sat, 25 May 2019 21:40:28 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4PLeSFw009063; Sat, 25 May 2019 21:40:28 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905252140.x4PLeSFw009063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 25 May 2019 21:40:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r348281 - in projects/fuse2: share/mk sys/fs/fuse tests/sys/fs X-SVN-Group: projects X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in projects/fuse2: share/mk sys/fs/fuse tests/sys/fs X-SVN-Commit-Revision: 348281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F30D28A5B6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 21:40:29 -0000 Author: asomers Date: Sat May 25 21:40:27 2019 New Revision: 348281 URL: https://svnweb.freebsd.org/changeset/base/348281 Log: fusefs: misc build fixes * Only build the tests on platforms with C++14 support * Fix an undefined symbol error on lint builds * Remove an unused function: fiov_clear Sponsored by: The FreeBSD Foundation Modified: projects/fuse2/share/mk/bsd.compiler.mk projects/fuse2/sys/fs/fuse/fuse_internal.c projects/fuse2/sys/fs/fuse/fuse_ipc.c projects/fuse2/tests/sys/fs/Makefile Modified: projects/fuse2/share/mk/bsd.compiler.mk ============================================================================== --- projects/fuse2/share/mk/bsd.compiler.mk Sat May 25 20:53:23 2019 (r348280) +++ projects/fuse2/share/mk/bsd.compiler.mk Sat May 25 21:40:27 2019 (r348281) @@ -19,6 +19,7 @@ # COMPILER_FEATURES will contain one or more of the following, based on # compiler support for that feature: # +# - c++14: supports full (or nearly full) C++14 programming environment. # - c++11: supports full (or nearly full) C++11 programming environment. # - retpoline: supports the retpoline speculative execution vulnerability # mitigation. @@ -200,6 +201,10 @@ ${X_}COMPILER_FREEBSD_VERSION= unknown .endif ${X_}COMPILER_FEATURES= +.if ${${X_}COMPILER_TYPE} == "clang" || \ + (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 50000) +${X_}COMPILER_FEATURES+= c++14 +.endif .if ${${X_}COMPILER_TYPE} == "clang" || \ (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 40800) ${X_}COMPILER_FEATURES+= c++11 Modified: projects/fuse2/sys/fs/fuse/fuse_internal.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_internal.c Sat May 25 20:53:23 2019 (r348280) +++ projects/fuse2/sys/fs/fuse/fuse_internal.c Sat May 25 21:40:27 2019 (r348281) @@ -208,7 +208,7 @@ fuse_internal_cache_attrs(struct vnode *vp, struct ucr if (!cred) cred = curthread->td_ucred; - ASSERT_VOP_ELOCKED(*vpp, "fuse_internal_cache_attrs"); + ASSERT_VOP_ELOCKED(vp, "fuse_internal_cache_attrs"); fuse_validity_2_bintime(attr_valid, attr_valid_nsec, &fvdat->attr_cache_timeout); Modified: projects/fuse2/sys/fs/fuse/fuse_ipc.c ============================================================================== --- projects/fuse2/sys/fs/fuse/fuse_ipc.c Sat May 25 20:53:23 2019 (r348280) +++ projects/fuse2/sys/fs/fuse/fuse_ipc.c Sat May 25 21:40:27 2019 (r348281) @@ -94,7 +94,6 @@ SDT_PROBE_DEFINE2(fusefs, , ipc, trace, "int", "char*" static void fdisp_make_pid(struct fuse_dispatcher *fdip, enum fuse_opcode op, struct fuse_data *data, uint64_t nid, pid_t pid, struct ucred *cred); -static void fiov_clear(struct fuse_iov *fiov); static void fuse_interrupt_send(struct fuse_ticket *otick, int err); static struct fuse_ticket *fticket_alloc(struct fuse_data *data); static void fticket_refresh(struct fuse_ticket *ftick); @@ -296,13 +295,6 @@ fiov_adjust(struct fuse_iov *fiov, size_t size) bzero((char*)fiov->base + fiov->len, size - fiov->len); } fiov->len = size; -} - -/* Clear the fiov's data buffer */ -static void -fiov_clear(struct fuse_iov *fiov) -{ - bzero(fiov->base, fiov->len); } /* Resize the fiov if needed, and clear it's buffer */ Modified: projects/fuse2/tests/sys/fs/Makefile ============================================================================== --- projects/fuse2/tests/sys/fs/Makefile Sat May 25 20:53:23 2019 (r348280) +++ projects/fuse2/tests/sys/fs/Makefile Sat May 25 21:40:27 2019 (r348281) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/fs @@ -7,7 +9,9 @@ TESTSDIR= ${TESTSBASE}/sys/fs TESTSRC= ${SRCTOP}/contrib/netbsd-tests/fs #TESTS_SUBDIRS+= nullfs # XXX: needs rump +.if ${COMPILER_FEATURES:Mc++14} TESTS_SUBDIRS+= fusefs +.endif TESTS_SUBDIRS+= tmpfs ${PACKAGE}FILES+= h_funcs.subr