From owner-freebsd-current@freebsd.org Sun Aug 11 03:37:49 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 153CDAE1DB for ; Sun, 11 Aug 2019 03:37:49 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (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 465l6h0ZScz4WDb for ; Sun, 11 Aug 2019 03:37:47 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf1-f48.google.com with SMTP id c9so72102300lfh.4 for ; Sat, 10 Aug 2019 20:37:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=o0yKnO72vP/FPH8QccE++7EiHJGnmsSWZq1kvmRSWmw=; b=PABYprtLtQmtuMAtqKqji6XriTCfWbk7lglvB6ADQtrcQ9UdbwXYyw6qfVFLxWAzNZ no9x82SRsvwjbRMRm3qtkBqiv8tqLmQ3SVRCqSDXVtoORozvmH4ijO79TRIRr87IQeag c2exgYNK/YmLLhKbkIDevK9EGESbMhZdwBffr82kuVUqk22SOd113Fq09avgb8wSP7aP PjkXAdIe7HoGZEh3bNMwnm2wh2v9BNLlZK1WhixVjmJw0ko/ShrpT8PF/i82JDOB+5yk VKScFATk9Voqg3zpJudztz0A5d3SqHpHh1MO66vXnr4VXdJTAeBCTdxFepMjA8asTc/L FdSA== X-Gm-Message-State: APjAAAXr/3UWyO8UFyL/nv5zOYISRrF9HOEdIUFUg0kKNQ5CasT4v45Y kEd5u7Nc1I/pGa1GlM/0VrJ5UVBwIEWP4FBLGgA= X-Google-Smtp-Source: APXvYqwv4jCCeB5ZsKrXGqJq8Mcy5jJBqbNd1lXvWZHlj7UqEPPSJTFjdAL9UlJ1/x7c7GB36QBEs5nIPDnTMinSx4w= X-Received: by 2002:a19:6904:: with SMTP id e4mr17018198lfc.156.1565494666212; Sat, 10 Aug 2019 20:37:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Alan Somers Date: Sat, 10 Aug 2019 21:37:34 -0600 Message-ID: Subject: Re: RFC: should lseek(SEEK_DATA/SEEK_HOLE) return ENOTTY? To: Rick Macklem Cc: "freebsd-current@FreeBSD.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 465l6h0ZScz4WDb X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.167.48 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-3.25 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; IP_SCORE(-1.26)[ip: (-0.48), ipnet: 209.85.128.0/17(-3.38), asn: 15169(-2.40), country: US(-0.05)]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[48.167.85.209.list.dnswl.org : 127.0.5.0]; SUBJECT_ENDS_QUESTION(1.00)[]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] 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 03:37:49 -0000 On Sat, Aug 10, 2019 at 8:03 PM 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. > > 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. I vote option 2. > > What do others think? rick > ps: The man page should be updated, whatever is done w.r.t. this.