From owner-freebsd-hackers@freebsd.org Sun Mar 3 01:02:26 2019 Return-Path: Delivered-To: freebsd-hackers@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 3FE541519EE1 for ; Sun, 3 Mar 2019 01:02:26 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CCC68D115 for ; Sun, 3 Mar 2019 01:02:25 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf1-f52.google.com with SMTP id 131so1055631lfa.5 for ; Sat, 02 Mar 2019 17:02:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ohD1f3Ox+9VHloeb66MbX2uGbpZ30c9wSGwtkKW8C5w=; b=p7aHhcwjsTomAl/uN1e5YfuAIPoqqJwoSDUiBqrtp3E+klzRCpF2+Q11V7PCpiwLPK obj/ds7nLaML0MGn95Y+wiDFXYi5mGk+r+Sy0fKkJrg5aFKhvjT0YiyrF1uCyu4n/hdT SLX6UGiXodIHgMTFpC8utqFCGedIc2hZm5rc/ccTCbFTH8n/ygTEatw1V2oM/CBAMSsK tQSHuQLNsptLb6CiycSxCIO/f6LoCsy5WIdoNTyVlcyNBWC2zDn2RVoal5iCIi6AyN2Q GF8+Yn8lwWUDF5anWyqYuSlrMwtRZ2697o+5EeUcTacLYbSEc9aM/unPJE1V1kBgz1sp IgCA== X-Gm-Message-State: APjAAAXF248RWuFsEuOcT5tv+UZzMXWxdw3XvOiD3bAnXbtGq+fT1FMV SDkKP+89/tN5STefz4UJSI5qWkuUObHmXGQLMwSHEg== X-Google-Smtp-Source: APXvYqxyr/2AFnUi+2fv/yYsZQK4YB1PpPGQYemI0NsgVqU/opjX40dJPsZpNRtnI52jGD0WCzc0FsHkqgsfNREdv4E= X-Received: by 2002:ac2:4343:: with SMTP id o3mr6013319lfl.129.1551574937397; Sat, 02 Mar 2019 17:02:17 -0800 (PST) MIME-Version: 1.0 From: Alan Somers Date: Sat, 2 Mar 2019 18:02:06 -0700 Message-ID: Subject: Adding namecache entries outside of vfs_lookup and vn_open ? To: FreeBSD Hackers Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 5CCC68D115 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.167.52 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-2.73 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.95)[-0.954,0]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_TRACE(0.00)[0:+]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.47)[-0.468,0]; RCVD_IN_DNSWL_NONE(0.00)[52.167.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.30)[ip: (-0.58), ipnet: 209.85.128.0/17(-3.83), asn: 15169(-2.03), country: US(-0.07)]; RCVD_TLS_LAST(0.00)[]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_DOM_EQ_FROM_DOM(0.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Mar 2019 01:02:26 -0000 It looks like lookup and open are the only common vops that create new namecache entries. At least, those are the only ones that set MAKEENTRY in the cn_flags field. However, fuse(4)'s create-like operations (FUSE_CREATE, FUSE_SYMLINK, etc) all return enough information to create a namecache entry for the newly created file. As-is, an operation like FUSE_CREATE will almost always be followed up by a FUSE_LOOKUP, necessitating an extra round-trip to userland. Would it be possible and wise to add these newly created entries to the namecache automatically? -Alan