Message ID | 20240301013028.2293831-3-zhanggenjian@126.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-87777-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp796456dyb; Thu, 29 Feb 2024 17:38:01 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUFCxyGET/Y/W2EZ431QaRP5kG3uC/QeXsSIbS3EdxmpxNMy4u4xWeQg8ZvZCbE9vo6MKeSpcIkPeoWCHv/C9cv/TJT6Q== X-Google-Smtp-Source: AGHT+IFLez2gF4dlltZ5jNemquXTYq3NkbPZQytAPCzH1J5uC5vHopMwM+0jFFu5663FMuvq7idV X-Received: by 2002:a05:6808:1b24:b0:3c1:d377:d1b0 with SMTP id bx36-20020a0568081b2400b003c1d377d1b0mr89150oib.27.1709257080949; Thu, 29 Feb 2024 17:38:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709257080; cv=pass; d=google.com; s=arc-20160816; b=QvQ6Z0u/PnLR/Gwc+bfcM48sBv2YisPPJV/MmqCwiyE0csQQ2aj+mKYw4oxxjQrJQl ZCb+YknPtlkSyVfb2xZD7TdH04Qz55VwJmL/gKph6lBwV4Ll6z7IjdUXmaXRuurY/I3g y4RKGZzYQpeeEFmD9Qdm2414OqUiAfP3xdWkqCzQxnDmK2wOw04GPgxeQE/+kMoPBXyX ulk0s3nrm/0hUPI4viuIXqbnogxY5gvEGdWGnWw2+cRrZoq50ZDel5MBrbEawFC5S9/W pNYJ43jfjIaJO7A7h6aruy79m2l9QJT8HF1SkkNikamCHQmPNg7o9yr5rnB5FfNImzgd L0uQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=8CY1ODlw6c1e5TwxkQwAen6QJmz56H/WmfOZ5M5TNM0=; fh=FFKu/FeHs2x1y6nXoGBLONL5xTxqg4RDxS5ieozMQsk=; b=KzKFIMDqhP65kXIPMr+p/vdsD9NKKgr5VS/0wrhJLTWQmrje6rdvYe6tcOX+3Km6JO zeHTq0ak0KrWsOmKbWsrHyAXWD6fxSUqeN0j5BNBSf1//z2dHqFA+Wrt78/NE1sS98iJ Cl008NFjwsTH1stJi0n2QxlnM70EEBVNw5HTfY9c0KyqF2fOWbdTY/MhHVMypV1+az+W 0kSlA624god7N7SCr8x+kAOfq7QgxLtI+HvRvPL7ovRUp6o3cf+ez+WWuIG5azFhltZA uPSEq3wCj5Zl+JGY8/uTm2DpTzipbDX/d3i25sPV2SpsmhYXlkInmpxJMlW3v9Hw89N9 ROZg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@126.com header.s=s110527 header.b="H/ka5F9V"; arc=pass (i=1 spf=pass spfdomain=126.com dkim=pass dkdomain=126.com dmarc=pass fromdomain=126.com); spf=pass (google.com: domain of linux-kernel+bounces-87777-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87777-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=126.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id u18-20020a634552000000b005cd8123afb5si2478394pgk.547.2024.02.29.17.38.00 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 17:38:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87777-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@126.com header.s=s110527 header.b="H/ka5F9V"; arc=pass (i=1 spf=pass spfdomain=126.com dkim=pass dkdomain=126.com dmarc=pass fromdomain=126.com); spf=pass (google.com: domain of linux-kernel+bounces-87777-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87777-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=126.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 48794B231B6 for <ouuuleilei@gmail.com>; Fri, 1 Mar 2024 01:35:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0CD873AC26; Fri, 1 Mar 2024 01:33:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=126.com header.i=@126.com header.b="H/ka5F9V" Received: from m16.mail.126.com (m16.mail.126.com [220.197.31.6]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 69AD12E416; Fri, 1 Mar 2024 01:33:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.6 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709256794; cv=none; b=AivCyWmVrDaToGGQy9lTGrgheLzcUUB8OBf3puoFRfc1T7Twu5XgD8CnJ8x03fk++PezdNelbefuTzePAPuYgZEEJ5th2kMsBzMcmuLGJhLCmd8kwgywK+mH1NEvhtxKAwOA9HcxwVOE/ycczcfk2DcCSKV9uPltGe8Su5Mfbsg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709256794; c=relaxed/simple; bh=lbTVUMhxn1ktqI2lN9lgHcss1yek4QTPVEjRudHaEF4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=guDCQw/3B6/T2e05xr+RM7Itqto70EMcBbKYRAdREfVK0ucW+a77rCjxp5gTnn29CJWPfbDBIhsTezOaqwbnOtPmlDCv/E9h/vcK53Hga8QPJAixBzE1Q7wA+gV2I/XLzo+aagkPJ2RUiuLdhRfQtp0ommNgwCQCqRNrNCpEjk8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=126.com; spf=pass smtp.mailfrom=126.com; dkim=pass (1024-bit key) header.d=126.com header.i=@126.com header.b=H/ka5F9V; arc=none smtp.client-ip=220.197.31.6 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=126.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=126.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=8CY1O Dlw6c1e5TwxkQwAen6QJmz56H/WmfOZ5M5TNM0=; b=H/ka5F9VbgyctHVrx1qn9 bu1MR3Ms18eCq9AjYs+dTnFsm6NzfYDlNWN9mHmreS9iZzqGBayqh8TLNneTZLFQ ozUb30wpFAmlOA+t5yKgkPyOfj4f9YjCuK2u+b8l3r87DOBNZIQYD0XzM2Hx2TDQ NxOnxF/aaBXn/Rbnn3YQss= Received: from localhost.localdomain (unknown [116.128.244.171]) by gzga-smtp-mta-g1-0 (Coremail) with SMTP id _____wDn7+APMOFlZSfbBA--.18054S6; Fri, 01 Mar 2024 09:32:38 +0800 (CST) From: Genjian <zhanggenjian@126.com> To: stable@vger.kernel.org Cc: axboe@kernel.dk, stable@kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, zhanggenjian123@gmail.com, Martijn Coenen <maco@android.com>, Christoph Hellwig <hch@lst.de>, Bob Liu <bob.liu@oracle.com>, Bart Van Assche <bvanassche@acm.org>, Genjian Zhang <zhanggenjian@kylinos.cn> Subject: [PATCH 4.19.y 2/9] loop: Call loop_config_discard() only after new config is applied Date: Fri, 1 Mar 2024 09:30:21 +0800 Message-Id: <20240301013028.2293831-3-zhanggenjian@126.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240301013028.2293831-1-zhanggenjian@126.com> References: <20240301013028.2293831-1-zhanggenjian@126.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _____wDn7+APMOFlZSfbBA--.18054S6 X-Coremail-Antispam: 1Uf129KBjvJXoW7Ar43AryfuFy7try5Xr4xZwb_yoW8WrWxpF nrWFyjyFWvgF48CFWUWrWkZa45Gan7G3y3XFW2k3y5ur43Z3savr9Ika4xXr1DJFW8WFWY v3Zakr10qw1UCrDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UiqXLUUUUU= X-CM-SenderInfo: x2kd0wxjhqyxldq6ij2wof0z/1tbiyBqUfmWWf0mcQwAAsi X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792285953204383977 X-GMAIL-MSGID: 1792285953204383977 |
Series |
[4.19.y,1/9] Revert "loop: Check for overflow while configuring loop"
|
|
Commit Message
Genjian
March 1, 2024, 1:30 a.m. UTC
From: Martijn Coenen <maco@android.com> [ Upstream commit 7c5014b0987a30e4989c90633c198aced454c0ec ] loop_set_status() calls loop_config_discard() to configure discard for the loop device; however, the discard configuration depends on whether the loop device uses encryption, and when we call it the encryption configuration has not been updated yet. Move the call down so we apply the correct discard configuration based on the new configuration. Signed-off-by: Martijn Coenen <maco@android.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bob Liu <bob.liu@oracle.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Genjian Zhang <zhanggenjian@kylinos.cn> --- drivers/block/loop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 52481f1f8d01..bd94406b90c9 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1286,8 +1286,6 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info) } } - loop_config_discard(lo); - memcpy(lo->lo_file_name, info->lo_file_name, LO_NAME_SIZE); memcpy(lo->lo_crypt_name, info->lo_crypt_name, LO_NAME_SIZE); lo->lo_file_name[LO_NAME_SIZE-1] = 0; @@ -1311,6 +1309,8 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info) lo->lo_key_owner = uid; } + loop_config_discard(lo); + /* update dio if lo_offset or transfer is changed */ __loop_update_dio(lo, lo->use_dio);