From owner-freebsd-current@freebsd.org Sun Aug 11 16:20:53 2019 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E9B6BC73E for ; Sun, 11 Aug 2019 16:20:53 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) (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 4664391JGyz45yt; Sun, 11 Aug 2019 16:20:52 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wm1-x32d.google.com with SMTP id 10so10070096wmp.3; Sun, 11 Aug 2019 09:20:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=OGQMgEzOrapv9chm7jotOh4O3vxL1LnawQcJ+4Gl8Wc=; b=axO+hVVDjCxb5ilhCgs/ALNmCXCpnAIn8yhal83jMVYmucrcfGpDMeZ0/bqjt61xRR EyUBj5CmuVeinOe0WLt3TRWnriR9L2b1OKtfhFrA9UvbFfpKN/dvwk8POt0c64fnNFpr 9KlZ4OgyPL9/erNL3HDKGA0r8gPgDlpMe407RrvOm4kvXn3LwaiNB+EkaNdhFfFbmIr3 MzxkDC8MSEa7MEXcp08nmfxIiumnO3c1G2bz+z6lA9VeRMpGEJi7olzJiLD4kxYbV86C AwaOGEKQW7f0fIDNaMOjKwOq6xKOfPL8l5m7DDXGMjudFa/UXD0NvkcHudZFLWSo9C/I uZ7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=OGQMgEzOrapv9chm7jotOh4O3vxL1LnawQcJ+4Gl8Wc=; b=TtXRVgUMEELSTKsrt2d4sm75VOBojf/3zTBTgBsj9sE9xIDwz3WWDsFvXmC+UUpofE XGfYbmtvyXqFp4zATIFCNLMUmslSBmV8As9/kUbbx7jP8Hecr+hfbf9Jf9cE0KfPM8OC OFYG4A6JU3HFh3TK7x8zhbVD5pL4TqIvdxiymTWek5TzBYx3QT7opl2ryn3QOVCeGRPK JI7demRhoLkPGIuif3IJorhpo89ARNgTeHSz/M0o49+9DlDGlcCNueMO3yoQtp09mkrL VLeIquCiBYFQol2E+KUM+bFjcJB/NSCT5Scq3TKL7aBd13YuEgdY8NTL6WqYAIDGcEbA VfVA== X-Gm-Message-State: APjAAAV7iKbHPKRaITLCj++EU+tK/7Z1bNsdkkuuyA4HK/kMaSIz0ye1 cmOynon6wFthJdm3VonHf07CL7fA X-Google-Smtp-Source: APXvYqyS+wxMhKz4upFJF1KRbXuhYDgk6yrSlezDGnWHbJI8sVVpJHIJ+eyE5SzhTCwhOm3bR+9HVA== X-Received: by 2002:a1c:9a46:: with SMTP id c67mr4126090wme.152.1565540451340; Sun, 11 Aug 2019 09:20:51 -0700 (PDT) Received: from ernst.home (p5B3BE66A.dip0.t-ipconnect.de. [91.59.230.106]) by smtp.gmail.com with ESMTPSA id j20sm9215339wre.65.2019.08.11.09.20.50 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 11 Aug 2019 09:20:50 -0700 (PDT) Date: Sun, 11 Aug 2019 18:20:49 +0200 From: Gary Jennejohn To: Ian Lepore Cc: Rick Macklem , "freebsd-current@FreeBSD.org" Subject: Re: RFC: should lseek(SEEK_DATA/SEEK_HOLE) return ENOTTY? Message-ID: <20190811182049.1e707887@ernst.home> In-Reply-To: References: <20190811090405.50cc49b1@ernst.home> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4664391JGyz45yt X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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: Sun, 11 Aug 2019 16:20:53 -0000 On Sun, 11 Aug 2019 08:57:04 -0600 Ian Lepore wrote: > On Sun, 2019-08-11 at 09:04 +0200, Gary Jennejohn wrote: > > On Sun, 11 Aug 2019 02:03:10 +0000 > > Rick Macklem wrote: > > > > > Hi, > > > > > > I've noticed that, if you do a lseek(SEEK_DATA/SEEK_HOLE) on a file > > > that > > > resides in a file system that does not support holes, ENOTTY is > > > returned. > > > > > > This error isn't listed for lseek() and seems a liitle weird. > > > > > > > ENOTTY is the standard error return for an unimplemented ioctl(2), > > and SEEK_HOLE ultimately becomes a call to fo_ioctl(). > > > > > I can see a couple of alternatives to this: > > > 1 - Return a different error. Maybe ENXIO? > > > or > > > 2 - Have lseek() do the trivial implementation when the VOP_IOCTL() > > > fails. > > > - For SEEK_DATA, just return the offset given as argument and > > > for SEEK_HOLE > > > return the file's size as the offset. > > > > > > What do others think? rick > > > ps: The man page should be updated, whatever is done w.r.t. this. > > > > > > > I also vote for option 2 > > > > If SEEK_DATA and SEEK_HOLE don't return the standard "ioctl not > supported" error code and return a fake result, how are you supposed to > determine at runtime whether SEEK_HOLE is supported or not? > My understanding of what Rick wrote was that, upon receiving ENOTTY from the ioctl, lseek() would simply do what he described in (2). His wording seems perfectly clear to me. -- Gary Jennejohn