Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2236219pxa; Mon, 24 Aug 2020 08:47:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYDQGO2XzoPT85AGXg6jSTmW3HMB1J+SFIl5XVngGrAXAcvDg1yulhsSS2Zpe/XGRk6nLz X-Received: by 2002:a05:6402:c9b:: with SMTP id cm27mr5241330edb.50.1598284036722; Mon, 24 Aug 2020 08:47:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598284036; cv=none; d=google.com; s=arc-20160816; b=BukiRFaPrJdOcgxKkmoyL3RDnf8gbOXBpp4cCmuO+LPZbtF7h/6wmuMmyqmr/PfAfD DpOqfMmVeBy18WO2HMniYjjPWrtMRbw7M8Slocg287nhbqK2DbIUBUao489UlmkwFD1B 0p5i6AEKTjgdkbyBWCEx6z5j15Sw1vb5A6u3tgPfByhc0Su/DdoYepW1DW/J1rfzVh1e y6GjMZ5g4xNQNLy2P8L29bXGxHxul7Mke+RMeCz04uapP3tIfd9BGBmFmmKtGNPWAMI5 nhGJ5pqG4h/gvDBED3zhSK5lJWibnvndmWg8Q7qEIM78mqaeBlFJwMkJ3nQZP5dP7nID vemg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:to:from:date; bh=McAhwUVcTSkg6Z0WPjgo6tUVqtfncLkMPEyLff8KkKg=; b=dRt23VgFQW/rLj7u/lmCKLVHc42ieDpR8XIgIoWL2rp2PgADgR+qzbjSr48qBlR1mC PGhDbhJTGdlrN/CYFa7x4HxsX11+HsUYUg4Y+1xUYhMZadfm1HEziq4aWosjEodTVU3D UeP0siHUBAMr0eU6SnB4BJ5K7HBFQV2wnJYidCmgmyhGKRu0qfOM45+paLBTmWcMVhO3 vt2zZ5rjzu3+mT9D3T7BOkTZC4fv3sA9UVZlMLTDyjRnnmfCX98/JlNe4qz6zVKLlrc0 tCcbRB+ZGcyyDFtc42PKBluNMNJCIq1Cz7GOXLOWrwisM/TESxZ4wmSGri75Z/2SI2qS LSjw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nr21si6858937ejb.741.2020.08.24.08.46.53; Mon, 24 Aug 2020 08:47:16 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728086AbgHXPpf (ORCPT + 99 others); Mon, 24 Aug 2020 11:45:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728070AbgHXPoo (ORCPT ); Mon, 24 Aug 2020 11:44:44 -0400 Received: from gardel.0pointer.net (gardel.0pointer.net [IPv6:2a01:238:43ed:c300:10c3:bcf3:3266:da74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3758C061573; Mon, 24 Aug 2020 08:44:43 -0700 (PDT) Received: from gardel-login.0pointer.net (gardel.0pointer.net [IPv6:2a01:238:43ed:c300:10c3:bcf3:3266:da74]) by gardel.0pointer.net (Postfix) with ESMTP id 810BCE80E9F; Mon, 24 Aug 2020 17:44:36 +0200 (CEST) Received: by gardel-login.0pointer.net (Postfix, from userid 1000) id 2FBAB16155C; Mon, 24 Aug 2020 17:44:36 +0200 (CEST) Date: Mon, 24 Aug 2020 17:44:36 +0200 From: Lennart Poettering To: Martijn Coenen , linux-block , LKML , Jens Axboe , Christoph Hellwig , Yang Xu Subject: LOOP_CONFIGURE ioctl doesn't work if lo_offset/lo_sizelimit are set Message-ID: <20200824154436.GA255257@gardel-login> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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