Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4100619pxb; Sun, 24 Oct 2021 19:59:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMo9IWJItYi9GddCbR00eha1pbK7XQt7GOa2Xxk1aCWvbNkamwvZ4xSq25S6zgAs+EOkQs X-Received: by 2002:a05:6402:42c8:: with SMTP id i8mr23178753edc.349.1635130776642; Sun, 24 Oct 2021 19:59:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635130776; cv=none; d=google.com; s=arc-20160816; b=xnSmUb3aeSA9jZWQ9X3ObNJdN4oUvHNA8oC65RrtVU2brMJ3e/CseQIFGnvHy1DP+h 5WHmkOrlRN/h9cK0enApOMuRAIYrVvvTJ5hTXnc1N8FfIts34bPM2KPoeu05CAPy4lcM VYfrv5OOavwtiddMhq7+pAN7EHueUkRU/U34zok5gUef4/YcJb9EcjBltYWAb1gT6DKS amGAmiixrb9K6be8qlcMB5+95XHAoaDLNOoRhEPB9zcIXs0F+Gmg9eWiTQTPiR6N85sS XCRID701e4P5CyNyecERrqWHsqxchVfbuG5pDT+YJLR9JwJ+YYObtpaxxDBMo0nPY/PU ysUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=kHLzd1yN1HItmCmiyo6e0YvO6hbI30slfLz3N4utYS8=; b=v1guQAtkCD5GMVKwRP7xtL5bg16T7xjVR3ZmVzb5Y3vYFhFrG4DXn18ezo9Ut7dGQR kmry0fUjxX+KcFgJXpwZeGAG2L/20olRRAb6V8I92r31GubRToof3bRvuATuWlA6olYp bjE/zx/HfEYcB7CLZSwTnxPOWelk1VGghGaUJO6zslpH4Xyph6TuUQ27/y8uhki59Vdj wdgwSI7nxfrHdFiUs9nKvWDY/fLYWqyWm4F7qfLyPieMiBdmwgfqpohYIOM4ZyqnJYt7 XfMASvJdKCBbY1gdiAXNa/M59omE/F4vmsSJsekNKnPewg5d4XaZhaLf/EEc6whzewO7 aLBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VVGKDqQJ; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce20si28813077edb.423.2021.10.24.19.59.12; Sun, 24 Oct 2021 19:59: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=@redhat.com header.s=mimecast20190719 header.b=VVGKDqQJ; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232207AbhJYC5F (ORCPT + 99 others); Sun, 24 Oct 2021 22:57:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:56464 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229665AbhJYC5F (ORCPT ); Sun, 24 Oct 2021 22:57:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635130483; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=kHLzd1yN1HItmCmiyo6e0YvO6hbI30slfLz3N4utYS8=; b=VVGKDqQJtm5m5GIJUbdgsDFnnWCBbR1dTUDEPNgy+0oK38td3BDDnx7smNfP5kt3wOfYuS MY1hUJTmYtxg2S+rBhxClmM4Ei25p8ZI32CF/ys87Zg63YPM11eVhTg7U1/mSlPkzXQjQ0 n5PVR1uVrowBAoTbTxqMJg+TI3B86IY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-558-5NyMsUJ2PjqsX07MCK3nXA-1; Sun, 24 Oct 2021 22:54:40 -0400 X-MC-Unique: 5NyMsUJ2PjqsX07MCK3nXA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BB7AF10A8E01; Mon, 25 Oct 2021 02:54:38 +0000 (UTC) Received: from localhost (ovpn-8-18.pek2.redhat.com [10.72.8.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id C5C4D19D9D; Mon, 25 Oct 2021 02:54:32 +0000 (UTC) From: Ming Lei To: Jens Axboe Cc: linux-block@vger.kernel.org, Luis Chamberlain , Minchan Kim , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Ming Lei Subject: [PATCH V3 0/4] zram: fix two races and one zram leak Date: Mon, 25 Oct 2021 10:54:22 +0800 Message-Id: <20211025025426.2815424-1-ming.lei@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Fixes three issues reported by Luis Chamberlain with one simpler approach: - race between between zram_reset_device() and disksize_store() (1/4) - zram leak during unloading module, which is one race between resetting and removing device (2/4) - race between zram_remove and disksize_store (3/4) Also replace replace fsync_bdev with sync_blockdev since no one opens it.(4/4) V3: - no code change - update commit log or comment as Luis suggested - add reviewed-by tag V2: - take another approach to avoid failing of zram_remove() - add patch to address race between zram_reset_device() and disksize_store() Ming Lei (4): zram: fix race between zram_reset_device() and disksize_store() zram: don't fail to remove zram during unloading module zram: avoid race between zram_remove and disksize_store zram: replace fsync_bdev with sync_blockdev drivers/block/zram/zram_drv.c | 39 ++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 8 deletions(-) -- 2.31.1