From nobody Fri Oct 07 10:49:07 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MkQ6D2QL2z4V3X1 for ; Fri, 7 Oct 2022 10:49:08 +0000 (UTC) (envelope-from bugzilla-noreply@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MkQ6D18J7z3b5h for ; Fri, 7 Oct 2022 10:49:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MkQ6D04mXzZSq for ; Fri, 7 Oct 2022 10:49:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 297An79i069109 for ; Fri, 7 Oct 2022 10:49:07 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 297An7si069108 for bugs@FreeBSD.org; Fri, 7 Oct 2022 10:49:07 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 266886] [FUSEFS] Handling of l_whence with fcntl(F_GETLK) Date: Fri, 07 Oct 2022 10:49:07 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: jmillikin@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665139748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kppi39rQVckNMGVRly/Qo7gB+qpE7HSf9xMnP43RWys=; b=HT0EWg49vNbctijOfkEui2lQt5eXv7X1MAUZKim4l3Uo12CMJVBytqZkjfDQXdJ/OwCo90 gJHjJf/HDB9eOHYgoab8yrwxIB5hME8w/4boXpwvHLDISydqDeh/G/EIcwiQbpAGHm9xTl 0IlqWGmLYDuA/2Pq2mr5+Gowjjd1FFZOFmDyNw6msDBrQIZ7TXQne21yTiHhvT2cv0aRfY E9DMuVX0fgqIRt//FmROzIPhw1LwoMCqxO4bu/6FCu89OmSbacYRkPUGI9NmGjJevIhUq2 qwa+NKuHMQHjekx0Upk0U9OYetsh+eJmZZgMsya7pyDx3REVEbtaxBy3JjmJmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1665139748; a=rsa-sha256; cv=none; b=rrx7KpHlr5Vd7DNrqLpiBeKnTimbMDCK2Xy3vhd4V9S05jQi658h0hxh+psPI7uuhHD+qr xOh/7GSiEF++3X34zTjznAFdAEBBioxNt+ri3QnKoRZsEAJbbaujpIdXeXr//8PvIL6szn ZUKnKibUY81bQM1WuCBYaqIFMWbha97P2Y6siOE8rIvihf3JBniOs7w3+makL8SYONXcsd IjeXvwZiCm74BmxHH5ajIdF0Gz9cREhiwbAbGXti1NYZTJZqu0fnNLfKI63jCogEE7cI/G fldrpaJDzdmp6buIH45YXXvRST1nLqswRM0x3ewpHLk5mgHuLoKd4b9U5WopBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D266886 Bug ID: 266886 Summary: [FUSEFS] Handling of l_whence with fcntl(F_GETLK) Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: jmillikin@gmail.com I'm not 100% sure this is a bug, but it's a difference in behavior from FUS= E on Linux, and IMO the Linux version's behavior is more correct here. When using fcntl(F_GETLK) to check for the presence of advisory locks, it's possible to set the flock structure's `l_whence` field to `SEEK_CUR` or `SEEK_END` to adjust how the `l_start` and `l_end` fields are interpreted. = For example, `SEEK_CUR` means they are relative to the file's current position. FUSE doesn't pass through `l_whence`, so the Linux kernel does the adjustme= nt itself when generating the FUSE request. When parsing the response, it overwrites the flock structure's `l_whence` field to `SEEK_SET` to signal t= hat absolute positions are being reported.=20 FreeBSD's implementation of FUSE_GETLK doesn't have this behavior, it passes through the start and end offsets as-is in both directions. This causes FUSE mounts to have abberent advisory lock reporting for binaries that depend on= the Linux behavior. (all of the above applies to F_SETLK / F_SETLKW also) --=20 You are receiving this mail because: You are the assignee for the bug.=