Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2345131pxa; Mon, 24 Aug 2020 11:29:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHdkGC6tFeRG4aqdvFqPYXu6IlwKcmOjgsaxil+WDT7ELp1oVHXSHc1qYh91HAZucrDwM6 X-Received: by 2002:aa7:d54d:: with SMTP id u13mr6862315edr.356.1598293776563; Mon, 24 Aug 2020 11:29:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598293776; cv=none; d=google.com; s=arc-20160816; b=zdubn1XMT/jIAqjKQRBXn6CcSajnTM00Z8kbqJtOY5y88Un6CxZhZTqV8wH2omMpPN Grp36VISmwYR1eVe3/RU6dVMzygKcQEk6Sh0F5IetksjLgVrC+2+eSo+RnHCEczRLNCN M0VzYxKuyr0xrBbieWRHHQtcoMQtZ4Vpvc5P7zIkTmL+uBYmECoQeOpDU7D6TbkOW1fp Ps3uN8Xe7dm1QdexpnriTi8uvAvSuc/v9hqRyz9RHYIiX+/PCvSvbBHq/q8dsV1by3yc 5RjWBqBLOuuURM0kTxUqh2KuwkWStmxwI3cB+YqDLWgEY8c+cQ08OsOQNLXpq6K3Hl5U 38gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=OSM5pA9SWQyrteWcj7xcQCSKujeMY9ejX45tVYAfBoI=; b=ObikIPeBC3KwdbctSmPUvBa5KrCQYW9TzHcyWGpYQWRcsd9nEDiDVqXI5zRJGsNvwf CyU3zjSbGx/Qy2ULpeywR9GcjpIBTX6lN1UQNvkHChkePSRHlGTlet7CWCtXVcMAmHOL B3T4QB0ZGBipTQVADNbv2s5X6dZ7rwEjhxAihys+fClRu/Ck8sBd1RjfoL19O2FS6XvK JLhvITnPYDhB9A04hJcRrcESy3yR0n2scd8Vub2jYC3nfUvw0Q+COWMJIjk3GfOzUTtU IGRmV1OjQq7IQ9z9EicvcEx6x9S8rPkruP1gmz5P5QqN4GR2Qc8PsNr3dCdqkWbsduKd DQfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@android.com header.s=20161025 header.b=DsE8cuz6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=android.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a18si8007251ejr.616.2020.08.24.11.29.12; Mon, 24 Aug 2020 11:29:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@android.com header.s=20161025 header.b=DsE8cuz6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=android.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727042AbgHXSYZ (ORCPT + 99 others); Mon, 24 Aug 2020 14:24:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726719AbgHXSYS (ORCPT ); Mon, 24 Aug 2020 14:24:18 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AF50C061573 for ; Mon, 24 Aug 2020 11:24:18 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id s9so5020701lfs.4 for ; Mon, 24 Aug 2020 11:24:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=android.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OSM5pA9SWQyrteWcj7xcQCSKujeMY9ejX45tVYAfBoI=; b=DsE8cuz6Tnb5qD5lXMhQmBfbgz5KUNwN0GWr49phT2y0EJ71c1bWgsTkGaVRCjpxIW AvS1KhiLVpCAFVRHdd1pAmoDKAXHCDfPejKkBi4JI/+dRPzO6pkAHDqE6cSTnkxclpvF K+uzniqAUGswWvoSqfDBtFmOkpHh/P+SLTjyCk2x3l+qnSR99gEbLRKP+j9QrWvUeaEW bN2w2UdkHtDj75EjjFmTdkxBbd3QUZ7NmHYippV6atbmwdi45FV++tMsfKUeNSkxWNOQ qvQy1zR9GfxQUF5EMEGeV4/GnLExryISck/GJewEe+2aovUcpl2qJmeyM+3wKgViWH5b CUbQ== 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=OSM5pA9SWQyrteWcj7xcQCSKujeMY9ejX45tVYAfBoI=; b=mvp77LPRYazIwzgAJ+kydQA6jMUCIyamRQ+tiEXMriXc5+jeXvAppJkpuuBN1mdLFT xZLRasSZUAZPhlD+alRhNOHJAuiiT/CKaJNjKMl1wLMFZK08tjtT/pVYLuOimUqF/6BX 0yziZo8u77/3rSCibFsZcHSm6CNUnlVN/sgV60gOWKOlmsx+Z2a/0gEMmE4s99F5fby6 jZ04HKnAOpBLVbl6Z5lEmegioS5ZG3ztyBkI8ZNh16ZfKvyfFQXd4MQijnnUIg/KJ9/V x3MowjXL1jvMAOrI+uLf+JVcrVNX5+G4UOIya8hC7y6PxQmkz6n1y1Uwp39AntHb/As2 uwxA== X-Gm-Message-State: AOAM530AMn+hqmry+xgLvdVpjFe37wmpeiERoOpTjTHr1yWawNVjxX3/ ZvMkWehr3r568tN/Cwv8i6GM41y65rOZ3qhk+8B7kA== X-Received: by 2002:a19:8c3:: with SMTP id 186mr3225689lfi.61.1598293456483; Mon, 24 Aug 2020 11:24:16 -0700 (PDT) MIME-Version: 1.0 References: <20200824154436.GA255257@gardel-login> In-Reply-To: <20200824154436.GA255257@gardel-login> From: Martijn Coenen Date: Mon, 24 Aug 2020 20:24:05 +0200 Message-ID: Subject: Re: LOOP_CONFIGURE ioctl doesn't work if lo_offset/lo_sizelimit are set To: Lennart Poettering Cc: linux-block , LKML , Jens Axboe , Christoph Hellwig , Yang Xu Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Lennart, Thanks for the report, I'll look into it. FWIW, we've been using LOOP_CONFIGURE on Android with lo_offset/lo_sizelimit without issues, but it may be a particular configuration that's causing issues. Thanks, Martijn On Mon, Aug 24, 2020 at 5:44 PM Lennart Poettering wrote: > > Hi! > > Even with fe6a8fc5ed2f0081f17375ae2005718522c392c6 the LOOP_CONFIGURE > ioctl doesn't work correctly. It gets confused if the > lo_offset/lo_sizelimit fields are set to non-zero. > > In a quick test I ran (on Linux 5.8.3) I call LOOP_CONFIGURE with > .lo_offset=3221204992 and .lo_sizelimit=50331648 and immediately > verify the size of the block device with BLKGETSIZE64. It should of > course return 50331648, but actually returns 3271557120. (the precise > values have no particular relevance, it's just what I happened to use > in my test.) If I instead use LOOP_SET_STATUS64 with the exact same > parameters, everything works correctly. In either case, if I use > LOOP_GET_STATUS64 insted of BLKGETSIZE64 to verify things, everything > looks great. > > My guess is that the new ioctl simply doesn't properly propagate the > size limit into the underlying block device like it should. I didn't > have the time to investigate further though. > > Lennart