From owner-freebsd-current@freebsd.org Wed May 22 21:04:14 2019 Return-Path: Delivered-To: freebsd-current@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 4C20115B76C3 for ; Wed, 22 May 2019 21:04:14 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it1-x135.google.com (mail-it1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) (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 775556A5C2; Wed, 22 May 2019 21:04:13 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it1-x135.google.com with SMTP id g24so5728792iti.5; Wed, 22 May 2019 14:04:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=D6lC/MBtTyv/IOHURYrwLUAhB497aYu4iQrLe1kjA50=; b=D9oXGXGnf+r7H3XAkdKJioRXUBq/4QrpqI9Tvjl4xbFtunsuHDH6lA7qylfwF+eC6y EeY52Ft85zKj7bPTQDegvBLD5W9QmHOXqWjJ727GJDt3NOMtVWJ30gvcPlss2vMYYrY0 r4t/h9Tmf2zRMtGTP/d4UN7/nkTKGd9GP91Z1LmEH3z+LJQ+wdjHNrfCc/IU3/Y3+mRL V8z8pKv7kvLZ4qLJbn3WI1Dx0lkGrMTfzj2vXtQwy3fnE3wHebtQqud9JnLnxJ9Z+1ig I/NZRvNaTpzE+PV08B1MyZ7I/zUI0+kjOfp2UuRmelfkOrkrbCGmd482OzRdMFst7Ber A1Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=D6lC/MBtTyv/IOHURYrwLUAhB497aYu4iQrLe1kjA50=; b=KNI0+kNHKUcZ7yYcOAKXMugAEticyhv4U+p7GS/xgvSHMAEtFoPFhoYMc2xFc65TKM BZTyizfUq1o3ceu2tHGrYS13ToNPpwpiVRtoQsl4BA5TFhN/RnIjhZqZB99nEZoTj2w0 CcZpJDtz5hJvxoGEixtUweFOmYTY0bCMVhnS8rjymN1vKlQiiUAi/qzbYD3e57sourtR rkOPNmaBM6ZVVdySm5MAifwFOU+xwXAcSYZmK8z58i8Ayrs1LEcphE52swxnINKr2IDw 1v5quixym4e8cBt5JXL4/G1EPL71b/+Ru8asFnRJFwUZ1kUe2GgniMRgNl7meqaUdKfp J3dA== X-Gm-Message-State: APjAAAW0UhUMdNPPpCRTpboXPJVlnntjTcRSmJZKKhRjtklE3IkDY6KF zAWi9YsgmOQqV5dZxVElPR1AztDF X-Google-Smtp-Source: APXvYqzRymI7DEDg/GgFJv6EEWibRxYgdAaX10gcvKSvirhTl3XfmzEv5Q96BEwbnLlc281ZpeDB+Q== X-Received: by 2002:a02:6026:: with SMTP id i38mr3315850jac.117.1558559052210; Wed, 22 May 2019 14:04:12 -0700 (PDT) Received: from spy (cs-auth-dc-129-97-60-193.dynamic.uwaterloo.ca. [129.97.60.193]) by smtp.gmail.com with ESMTPSA id k22sm8367820ioj.60.2019.05.22.14.04.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 May 2019 14:04:11 -0700 (PDT) Sender: Mark Johnston Date: Wed, 22 May 2019 17:04:05 -0400 From: Mark Johnston To: Alan Somers Cc: Johannes Lundberg , Konstantin Belousov , FreeBSD Current Subject: Re: Weirdness when writing to pseudofs file Message-ID: <20190522210405.GA9444@spy> References: <6ec62e4d-9f93-ffe1-646c-3846c9308334@FreeBSD.org> <20190522175133.GC2748@kib.kiev.ua> <84e3001b-646d-b1d9-f206-577d63f79bf1@FreeBSD.org> 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-Rspamd-Queue-Id: 775556A5C2 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=D9oXGXGn; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::135 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-5.48 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[5.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; RCVD_TLS_LAST(0.00)[]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; IP_SCORE(-2.80)[ip: (-8.41), ipnet: 2607:f8b0::/32(-3.27), asn: 15169(-2.28), country: US(-0.06)] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 21:04:14 -0000 On Wed, May 22, 2019 at 12:03:00PM -0600, Alan Somers wrote: > On Wed, May 22, 2019 at 11:59 AM Johannes Lundberg wrote: > > > > > > On 5/22/19 10:51 AM, Konstantin Belousov wrote: > > > On Wed, May 22, 2019 at 10:36:34AM -0700, Johannes Lundberg wrote: > > >> Hi > > >> > > >> I'm fiddling with lindebugfs, which is based on pseudofs. When writing > > >> to a file, > > >> > > >> this works: # echo 1 >> /path/to/file > > >> > > >> but this does not: # echo 1 > /path/to/file > > >> > > >> "Operation not supported." is returned before the pseudofs code is even > > >> entered. > > >> > > >> Is this expected behavior? (if so, why?) > > > Does the file exist ? > > > > > > Pseudofs does not implement VOP_CREATE(), which is reasonable. > > > > Yes, it exists and my custom write function is receiving the call for > > ">>". (which is for example used by drm driver debugfs to do certain > > things on demand by accepting write to a debugfs file) > > First, you need to try ktrace to see exactly which system call is not > supported. If the problem still isn't obvious, then you can try > dtrace to see exactly which VOP isn't suppoted. Do it like this: > > sudo ktrace /bin/sh -c "echo 1 > /path/to/file" > sudo kdump > sudo dtrace -i 'fbt:::return /arg1 == 45/ {trace(".")}' -c "/bin/sh -c > 'echo 1 > /path/to/file/'" > > The dtrace command will show you which function returned EOPNOTSUPP. > However, it will also show a lot of functions that coincidentally > return 45 even though it's not an errno, and even functions that > return void. You can also trace VOPs with vfs::vop_*:return. The return value is in args[2].