Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp572198ybt; Wed, 8 Jul 2020 06:46:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDB/wj+75oXadHc14RMA7aIQcSmEGqXMQf/gzRa/PtqJEOvUg+KYw6LPva1iRMfHo1nnm7 X-Received: by 2002:a50:ee87:: with SMTP id f7mr68792007edr.355.1594216014853; Wed, 08 Jul 2020 06:46:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594216014; cv=none; d=google.com; s=arc-20160816; b=Xqg9y3CPOTiH+edeRzMrzVdv0tJuhfJ2tMaYW8SVpde961LiUJXkBuOOLJ/HRwXlHI IwwXIPlID7+vaSa3x928QeQWi8/oKWwRlEx/AalCiGJhLGH6jzUoVGznJDDhZwAXu5jl waleYeM2XbFzMRwvqq+Atclcv1aWtuXY+29oI4IH4LmrPxR1IWQQQqJEphiTNdaXyMNr E6DFs2V7IbT/l6RlOmUQcDeYbmXLQm9li05vdBQSFRkK1QrYXkGzFdjQYiaxa4corJ6o E5P1AbjO+bk6StoPNN0TCG4OroojzfCpj72LdWml0/ykacwjYGrn98mscOqvdd+tX/9i h0SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ALoTRUWpyoJ5TLvh/u0ihRx9QLx7mqPr8euUVwU9fWg=; b=SUBAvrnpETZyqQtzpNzO1ZRSG5IOB9Cj17gfIlPoKwtFRA6mHZfAUHPSJo+d3/wN3O J+L2oh74eo+3jGoxKkA8f5tKMLwUS3HJ0rrYy6cU6GNGzQ2e7XM7MUH8+iPV1MpgRfL/ smdbHXDDJEZ42awmSUPDAYrWoop+cFblrNG7HWMSZFbL5qA7MLsGP3JR9mROO3RPC2iI brDwOMn14emYTOUqavipCpVu8p3nI2fI5lCDvwNswUXq6lPFSIewRGOn7Wa5pPZG6G8m xiFXPL6PwlsAOt9+A2dNQFEuZKCheOyzRN0ls0voCQnp46Y2PAaW6sw2UvLcv6RHo9Tz KCgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=vz1Ro+du; 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 g26si31146edq.238.2020.07.08.06.46.31; Wed, 08 Jul 2020 06:46:54 -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=fail header.i=@infradead.org header.s=casper.20170209 header.b=vz1Ro+du; 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 S1729761AbgGHNpI (ORCPT + 99 others); Wed, 8 Jul 2020 09:45:08 -0400 Received: from casper.infradead.org ([90.155.50.34]:35430 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729288AbgGHNpH (ORCPT ); Wed, 8 Jul 2020 09:45:07 -0400 X-Greylist: delayed 1266 seconds by postgrey-1.27 at vger.kernel.org; Wed, 08 Jul 2020 09:45:06 EDT DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ALoTRUWpyoJ5TLvh/u0ihRx9QLx7mqPr8euUVwU9fWg=; b=vz1Ro+dufJWwWA7UmwzBycaTV9 /0RiH/WHQ+aVbPep3jyOFfC+FP1u5tkkrzFk3s7JyMNkln5i3pV7RpQjenFkFTWyUGqMRVwvT//JA 7Ln8LUzELu+B67MOLF21c7RKpsTDp0q2wmslj7Ntk3r4uH00aI6JobFDMismYfceQWmV8votbz/S4 ZQt9RxMwIp7yniwMoRc8Yt83jF6EcSNpJy6aQnT765vpDWP5Pteo+uRvy+NPp2rx6eaewh0NRee7v XZWFjNktt65gVlkKlUHpxi37RmmbPgb+4++oEwChZy60usK+sCyjg2DVm/YCEOAtnEF7FdFI3hTee WeMGORlw==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtA31-0004Tm-CW; Wed, 08 Jul 2020 13:23:41 +0000 Date: Wed, 8 Jul 2020 14:23:38 +0100 From: Matthew Wilcox To: Guoqing Jiang Cc: Christoph Hellwig , Jens Axboe , Song Liu , Ulf Hansson , linux-kernel@vger.kernel.org, linux-xtensa@linux-xtensa.org, linux-block@vger.kernel.org, linux-raid@vger.kernel.org, linux-mmc@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 1/6] md: switch to ->check_events for media change notifications Message-ID: <20200708132338.GO25523@casper.infradead.org> References: <20200708122546.214579-1-hch@lst.de> <20200708122546.214579-2-hch@lst.de> <09cd4827-52ae-0e7c-c3d3-e9a6cd27ff2b@cloud.ionos.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <09cd4827-52ae-0e7c-c3d3-e9a6cd27ff2b@cloud.ionos.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 08, 2020 at 03:17:31PM +0200, Guoqing Jiang wrote: > On 7/8/20 2:25 PM, Christoph Hellwig wrote: > > -static int md_media_changed(struct gendisk *disk) > > -{ > > - struct mddev *mddev = disk->private_data; > > - > > - return mddev->changed; > > -} > > Maybe we can remove "changed" from struct mddev since no one reads it > after the change. You missed this hunk: +static unsigned int md_check_events(struct gendisk *disk, unsigned int clearing) { struct mddev *mddev = disk->private_data; + unsigned int ret = 0; + if (mddev->changed) + ret = DISK_EVENT_MEDIA_CHANGE; mddev->changed = 0; - return 0; + return ret; }