Message ID | 20241209165717.94215-3-ryncsn@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B8CAE77180 for <linux-mm@archiver.kernel.org>; Mon, 9 Dec 2024 16:57:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DAA3A8D008D; Mon, 9 Dec 2024 11:57:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D5A908D0058; Mon, 9 Dec 2024 11:57:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD44F8D008D; Mon, 9 Dec 2024 11:57:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 9EE438D0058 for <linux-mm@kvack.org>; Mon, 9 Dec 2024 11:57:58 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id AB29E1605E5 for <linux-mm@kvack.org>; Mon, 9 Dec 2024 16:57:52 +0000 (UTC) X-FDA: 82876026954.30.0B8F8C7 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by imf12.hostedemail.com (Postfix) with ESMTP id B198440009 for <linux-mm@kvack.org>; Mon, 9 Dec 2024 16:57:41 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=H+Jc+k3l; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf12.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.210.178 as permitted sender) smtp.mailfrom=ryncsn@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733763461; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=TWIw0hhAH4VJQ0Z+LUoADX7ca43ciXjofF1Ce/M4dOk=; b=Ohesf4fyh/bDYBUFowi6E6KpCO0ikLkRaDSth4v+U855Usc22BJQvESxwfqOAEyd1u1BBV /ydorTzVFHm+cSu8xdmUdxyH90f9sU4vS2goB22phteaMqEpSqbGg9soMy9lUxV9pOtsP2 ZGiD1wWWMkkngStmzq/8rwUc+vVreOo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733763461; a=rsa-sha256; cv=none; b=3xVY3gK8DB/v1Vux/KDSLVYY8mDpJFlTLFRLbKicKRvFRU6QeGzOWNjTOzd0YUM1iJhZEV +/TQSK2SlN8PVGRnBlI9g1zDl/PZ1tXcajPJp3VvURxZt3geVXb4/zG/v0thDYQ+opjG3h wGrcRAggjDZ6lKM6ZbwTQYohFto9e6A= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=H+Jc+k3l; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf12.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.210.178 as permitted sender) smtp.mailfrom=ryncsn@gmail.com Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-725ee27e905so1286051b3a.2 for <linux-mm@kvack.org>; Mon, 09 Dec 2024 08:57:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733763469; x=1734368269; darn=kvack.org; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=TWIw0hhAH4VJQ0Z+LUoADX7ca43ciXjofF1Ce/M4dOk=; b=H+Jc+k3lt8fMPy9gfxU2PmaWfIgYOeJqrzN9ICQgDM7csIx/Cxz96RzRFNdOGW9eJP aJtfkpVV5MzWZwfSFEdJNbfdx18vyO52qB0oNDrK4Z5anie13EBNYzEy6SRio+DMpd95 V3rchKpPP2yHb88WOyuBvjrZvaD6i0rRXq/EZdTYl7MMy39F2H4B351VW/psSAmS8Hb0 BGR8SUevucuXCp/pEw4nx5iWkZ5lkxIqVa2k23fHT/pws17GckxVuXAVlsjsA8NMapsp gqUIWDKdQP/HbLYmA27jbFDIv2/a+dsuHDwIzQOTSo2I1lfPl4hLIDXtbyX7JK3sU20s RiQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733763469; x=1734368269; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=TWIw0hhAH4VJQ0Z+LUoADX7ca43ciXjofF1Ce/M4dOk=; b=ECo7PV2nF2KrJgHl69F3bi8KjixObxtVAnOV/h0aMSSsxyq2QHJofSwSelBqK+BhY3 nIlKrewQwRRahssTlc2onQzyVhgxeeKZaOSv4Ea9IXsWrHQT5bZE0mJGDzcHS1fQSZcp OUinpu1gf/gE5glbuqiCrdZyWsYkAZbxWxbxIVxcD3WobmEz9/F8exK6MNYvKQOKilyw O8chK/0qvKHJUqxS/uMbepywtBw8DMXnIjg0ECp2CppMmc14rSmVdkD08yaRT6e1Vx8U 3VumGOHBPE9BJL+4h+2cax73ugbIeyBjGNL0KpwgR10u4AJiKGnmP5u0xbQBfrxeVYrq 4wuQ== X-Gm-Message-State: AOJu0YwWZBaS+AWgCnBjcOqKfTI4R1ATvWsO0muF1Nw9XRPCgC6fP6mv qNIBYGupKH0wL5SBe2BpV9GXOR1OfHnFl7sCLVE9AD6s6zhn3sSwyNMhpbk1BtIAow== X-Gm-Gg: ASbGncujvi+qpLA7urVkPcDPHru4gWfqxMS9ffrsZIWgx5YC3Rhw1r2fxNNPeuG4uZH vxHOHlsTvJodxvtrNhCguYY3aRTaHHGSodBjcg3ol5bYCSfZ/moAz03OVo0tmB8JSL0PGrhuV2Z gRYZgMbZDEQX8X1RKCK6JbgJq54QAq3pj9ruyphsIGqVDG5hVSiMf0gVsuJDxRRMvupGl/Ep33U zgCCxijKfVOpBV8aQIcqPv06wle2klaWRKB0rE41o7NfZNusBuy2NTYsqCqx224/zRii/I= X-Google-Smtp-Source: AGHT+IGPb5h1KzA7h2yK1etF1SPW3948xDox8qr2YCpFm0ctolrhSkaAbYueqzrsyOSh5QsXCLFdsg== X-Received: by 2002:a05:6a00:2e0f:b0:726:f7c9:7b28 with SMTP id d2e1a72fcca58-726f7c97e8emr3032663b3a.8.1733763468992; Mon, 09 Dec 2024 08:57:48 -0800 (PST) Received: from KASONG-MC4.tencent.com ([106.37.120.120]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7273c7f3f1fsm514201b3a.13.2024.12.09.08.57.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Dec 2024 08:57:48 -0800 (PST) From: Kairui Song <ryncsn@gmail.com> To: linux-mm@kvack.org Cc: Minchan Kim <minchan@kernel.org>, Sergey Senozhatsky <senozhatsky@chromium.org>, Andrew Morton <akpm@linux-foundation.org>, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Kairui Song <kasong@tencent.com>, Desheng Wu <deshengwu@tencent.com>, stable@vger.kernel.org Subject: [PATCH v2 2/2] zram: fix uninitialized ZRAM not releasing backing device Date: Tue, 10 Dec 2024 00:57:16 +0800 Message-ID: <20241209165717.94215-3-ryncsn@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241209165717.94215-1-ryncsn@gmail.com> References: <20241209165717.94215-1-ryncsn@gmail.com> Reply-To: Kairui Song <kasong@tencent.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Stat-Signature: b8d5hazhc43oojtqrioca1n3r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MfJXEvKfUIYTu5fswkhBxYTe9xVJNSWrRgwb4PpFz/DlSUawF044HfewwcvZ8y9mNbpPqYtnt/tbb8NEPClsjLps1OpS3QlMjW4Q/47X2gp5+a3Z26Qqj7er8cj23LnZrk2EEb9LkaTScG8kLDGz6+YDT5PINhJUqdoi47uCKEoRBPJMKQERidRSR1/BIqwdCMiiArR7TYtMDm10f4x/UAnGEr9+o17FH/ujF9jXiZbCmJg8A+5egPZgvODWHfFjOKCCqsds1nJvmdz+cvHGw8Eu44HVpnUcV+AqqSt1S8YP1jAsK1zRfQLaDCdE893A4HtrTeh+/qDxW069OX5tqv7ZBSM6k7usp916uZs1pzXeJwsus2bKucO7XXLetp2rVifOrVDGXcYZY0VE1X+BKXNPITm9M6GFL6JJ8hOYT+GMk/Z7Cv6LgFfwTpMVW2ziT4OD5YAX4UVIyZ7M2NW7pWTatXVXRr/gEBFQUV81pri/gJ6l80a4BzJOonUOUmwUeXXSTjN73kHQyEmBZetmDjSaZt/H22sL9fT7iHKtTrfkSUArEZhUkKYSTF4 X-Bogosity: Ham, tests=bogofilter, spamicity=0.015274, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
zram: fix backing device setup issue
|
expand
|
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index e86cc3d2f4d2..45df5eeabc5e 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1444,12 +1444,16 @@ static void zram_meta_free(struct zram *zram, u64 disksize) size_t num_pages = disksize >> PAGE_SHIFT; size_t index; + if (!zram->table) + return; + /* Free all pages that are still in this zram device */ for (index = 0; index < num_pages; index++) zram_free_page(zram, index); zs_destroy_pool(zram->mem_pool); vfree(zram->table); + zram->table = NULL; } static bool zram_meta_alloc(struct zram *zram, u64 disksize) @@ -2326,11 +2330,6 @@ static void zram_reset_device(struct zram *zram) zram->limit_pages = 0; - if (!init_done(zram)) { - up_write(&zram->init_lock); - return; - } - set_capacity_and_notify(zram->disk, 0); part_stat_set_all(zram->disk->part0, 0);