From nobody Wed Oct 12 04:03:50 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 4MnJtG10SYz4fGgh for ; Wed, 12 Oct 2022 04:03:50 +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 4MnJtF65VQz4Nc9 for ; Wed, 12 Oct 2022 04:03:49 +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 4MnJtF5794z1BTR for ; Wed, 12 Oct 2022 04:03:49 +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 29C43nsQ013376 for ; Wed, 12 Oct 2022 04:03:49 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 29C43nkR013375 for bugs@FreeBSD.org; Wed, 12 Oct 2022 04:03:49 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: Wed, 12 Oct 2022 04:03:50 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed 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: Message-ID: In-Reply-To: References: 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=1665547429; 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: in-reply-to:in-reply-to:references:references; bh=4UV0kOMlYG7molRCJoSZanBDjGvxNcOfBfdmJtSJtfo=; b=jCAno1Lx+ZpRm1IzZyjKWRCORgw40LlC+gsgrs4N5m+KCj3k8wYexSbDLXsXUN67NtBQxB 0m99p/oGizfgHREHJA4HMiF1ROL9Th7qGqhvIuqkAmBXwH+UxYKxBbN4gZog+iXKFXrnkM SwUHQV6JnB/LlmUohcnHRkMdn85c/Gdz3MF1FYMZapvGDUff6Bh9GtuM/WH5PzavCMclKq RMUQQiRotSVpaIg5AtpKoEM3dlt/wKlBkA1OiXcnsfePVL6IFMa2nFqyM8UGdDRoZSe87h yN9kaDrLnDbygGbDTX1GHES/THx+sHN1mZ2wHX+uGW/4Z5mkk4ibS6lOCniOYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1665547429; a=rsa-sha256; cv=none; b=xVW5Arfbt4lV9Ij5gFtcc9apGfge6lPz4yO8cDT24GclePLSzZnpUP/Mt0EsPGTWCuUeih DcLzpqLcQC1flV+3oeglRREQUFOnN8LYweyCU29HrWMQVO+hJ5e7gL4KDTTtIrfxDiZ7i8 nSvPjFaqeQNXwrv+aEY6q8AkKph/1SQV5QXLqPIbHj79AS+uiyNvi+dxXots/3y20rwm3Q V7J0Jl/tINvg9Cpu/Qo9fLSme6OneAeWyUwD1T1Ik+380spUpSgKKOPwRHWB9j5iY72zp1 EKT7m31mgPPvzhryIdymrWbcsn29lHe9maTc+DQ4K4WJl6l0wxgZwboYJgr2cQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D266886 --- Comment #2 from John Millikin --- I think my initial message was partially incorrect -- the offsets are being calculated correctly, it's just that `l_whence` doesn't get set to `SEEK_SE= T` when the call is complete. /* &fl populated per your example */ fcntl(fd, F_GETLK, &fl)); /* fuse server request and response RECV fuse_lk_in { lk: fuse_file_lock { start: 500, end: 509, .. },= .. } SEND fuse_lk_out { lk: fuse_file_lock { start: 500, end: 509, .. } } */ ASSERT_EQ(fl.l_start, 500); ASSERT_EQ(fl.l_len, 10); ASSERT_EQ(fl.l_whence, SEEK_SET); /* fails */ In other words, I would expect one of the following to be true after fcntl returns: 1. l_start is an absolute location within the file, and l_whence is SEEK_SE= T. 2. l_start is relative to the file position, and l_whence is SEEK_CUR. --=20 You are receiving this mail because: You are the assignee for the bug.=