From owner-freebsd-current@freebsd.org Sun Aug 11 14:57:08 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 2A978BAE63 for ; Sun, 11 Aug 2019 14:57:08 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4662BW5SmRz429X for ; Sun, 11 Aug 2019 14:57:07 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1565535426; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=uErKKDPVxRRj+/waSnAzvLTTGO/WXS571z7q5UyvyDwia1kXK/Ay/iHAz+mhY/z5DoM4Tel4uRRn5 0fqds59oBpoYIkYNo4XnRNghUDr6NydmH1Cm+pkydKQgzERmq8W/9i0fQuDsC6eMnaKKLbGdKt68+o IsO61/9Lw/Pgsg7DV/Ptp2swA8Tl10Jly7ibZioj903NHwGkmLb4B0/c6xliWfDClvv7NF4YfaAmqd DRNZf/LZAtzu+UZ8PDmeCSKZrQR3TNddoztMyRsMBZuNTYc5g7qb1qUXjOOaYlyuU/o2gaAUQ0k3Gg TgW5ObCvZPWi/cTfsMnryvkeS362u9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=lpa3d0k7nXlkaEUY7tXcE97SLA0oOC3lIjwddXtE4a8=; b=HMTqD3O7mh3UStjYIEWXehX8ayHDfCgQAII/dQvhvXzYbLl4w+Q8FsipZiMqjJsIrc01Cxh+4q/jb fiFHWdRDqJxh6o8wCRkCuCwLv/5kcBkFtwm7JsnEqt3L8rOUpP6RwsHxrOMpV4mAg88iokh6XE50bb FyMTQw/C/OS6h4BleGGyos3n8fDFVwqFkPX+CY7BmaVETL562LQGvPY5+Y5Z3GY6h8xEOwzDdyxnN/ zs2rOa9O+wMdbA4KGAQoUtCRrvDELHzGJwi1/9BNXSnsZCRJd3+f9CABODCes9UVZUY9tenCFIUDqk QNFY55R0uNhsFdqSEWLN9LOyJfrdpnA== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=lpa3d0k7nXlkaEUY7tXcE97SLA0oOC3lIjwddXtE4a8=; b=QDpzX5CaFWruys/W6k1A/8O46Mj/Z7qC8J6eF8EZOG9mFkjXio71xmz3acbYyDMmk9e2BNk2skLts zQKvSsDafK/8U6aa7+GU7hxb8wkGs5xeQLTS6YBUuxWhBZncj6vA129W6m29SXtP27w1+/qDmnb/zi 2Y1XycnPs6TF0YjUTlHDjtK1+FwqLXyD/bXCNaQZtVNjEbjosxXgAjP9yiHG3apt51arfieDf8lzNr L2myitTGpid36tMslSuZ64EoKsC69j2ay5lkQ+Z69TfLWgMjxK9JX0/cxFy97l8ZOUKoAoUsTPiokm rXWtyyxFJCZUBlj98iFpF738X+9PKhw== X-MHO-RoutePath: aGlwcGll X-MHO-User: 481bf7db-bc48-11e9-b67a-cdd75d6ce7a8 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 481bf7db-bc48-11e9-b67a-cdd75d6ce7a8; Sun, 11 Aug 2019 14:57:05 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x7BEv4DJ042060; Sun, 11 Aug 2019 08:57:04 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: RFC: should lseek(SEEK_DATA/SEEK_HOLE) return ENOTTY? From: Ian Lepore To: gljennjohn@gmail.com, Rick Macklem Cc: "freebsd-current@FreeBSD.org" Date: Sun, 11 Aug 2019 08:57:04 -0600 In-Reply-To: <20190811090405.50cc49b1@ernst.home> References: <20190811090405.50cc49b1@ernst.home> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4662BW5SmRz429X X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US] 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 14:57:08 -0000 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? -- Ian