Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp638566pxf; Thu, 25 Mar 2021 10:33:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuA4oehMQ/Cn9rISfoBEnBDDTnZJRtEXoPqBKjatUzE4Kyvny9034JqUVwY3X8Mojv4ZqY X-Received: by 2002:aa7:d841:: with SMTP id f1mr10296967eds.286.1616693588005; Thu, 25 Mar 2021 10:33:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616693587; cv=none; d=google.com; s=arc-20160816; b=0Cz/P32z0Vhv4CZXYkWpxgSQfcFhDGCopnD29fCwV5VD05b88jpyI0/2A1sKa6MQtC yaWH0sdQkW38Cu996vekTBMxMRagHwsVN3iMQBZmSySTapkz98LOXM2NkyZZ2Ej1lGXY 2Z0l5ySvJ3akY5AYyHbbneAuy6TKme4B7LmymoCB4Uk6MOVyi6GlLCFYpcoLD9cuw74r erb25grXXQHuZOVVZa3cl+3EG94t93Zu1EIgHI5ODVlK/kwIxLKq6PlC9vaCu45EUD3V EmUBHZ5wUGqcL4d/5LLVfdcJZEFz1qGIfikxHZNqZr0A4vl4YZZxYYeHOqtV/oQ08TzS KcLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=QQfTkgsngBop3Tqx5XH9+idTDW0MUYe7P31vACwHE+c=; b=x4/I9sQ2qEckocHIQlyqGqvYi08C1+W9ZGYNtWYYlus6cwe6ZnFdVhOri/TCk61r9I BHY2vE4bgo5Jo+2lGxPZLdUAHxoayQyZzsNPRoyDSL07a+/S/RTOUZw0rMxSMV5eLhw8 83HgmJsA+FELRu1xZkUbrzcym3dvYBDcqZNt+n1ZICsKpIzyFnV6+HJnnN/oUtJNdtMU VeypQr6ovNGnHAG6/n4otWGv+9E54J7EUilu935j8RJGQVUjcWafASLPJvkDdcSUpjCO LblRzZwyYhmOoMmBhA/kFYmuQ3UMilDhkRNnlvGbyNx9lm2T0km2B178OXDWCryqQwpx Odqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=amHaVZJM; 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=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z4si4819792ejj.20.2021.03.25.10.32.44; Thu, 25 Mar 2021 10:33:07 -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=@linux.microsoft.com header.s=default header.b=amHaVZJM; 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=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229642AbhCYRaH (ORCPT + 99 others); Thu, 25 Mar 2021 13:30:07 -0400 Received: from linux.microsoft.com ([13.77.154.182]:38202 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229592AbhCYR3r (ORCPT ); Thu, 25 Mar 2021 13:29:47 -0400 Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by linux.microsoft.com (Postfix) with ESMTPSA id 3EA4F20B5680; Thu, 25 Mar 2021 10:29:47 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 3EA4F20B5680 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1616693387; bh=QQfTkgsngBop3Tqx5XH9+idTDW0MUYe7P31vACwHE+c=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=amHaVZJM1c5uXjhVYTo1ubPgMMCmhg7sk0AYbM2TwoJexCKPlsCBxPg5aIu/Xr74Y Ho8vOLLIQ/uLTDkZDeSpQNlJ0pUe67rMR2ezdDBWAbX+Bl6jfzXKGgfqhZs6hGU8qV C6H0nihmJnvbvScDzYPRlWZiC9RLxBI9rLWC0f7o= Received: by mail-pg1-f180.google.com with SMTP id l76so2503211pga.6; Thu, 25 Mar 2021 10:29:47 -0700 (PDT) X-Gm-Message-State: AOAM530KulwDei525WfPzMBROGGaGcqv9IMZ5cjw9RogW3Wr64SgcDwP njLJ9F77ldByc3JeAQFqa5T/kdVdzFFDkaXBCPc= X-Received: by 2002:a63:2345:: with SMTP id u5mr8857421pgm.326.1616693386792; Thu, 25 Mar 2021 10:29:46 -0700 (PDT) MIME-Version: 1.0 References: <20210315200242.67355-1-mcroce@linux.microsoft.com> <20210315200242.67355-2-mcroce@linux.microsoft.com> <20210315201824.GB2577561@casper.infradead.org> <20210315210452.GC2577561@casper.infradead.org> In-Reply-To: <20210315210452.GC2577561@casper.infradead.org> From: Matteo Croce Date: Thu, 25 Mar 2021 18:29:10 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH -next 1/5] block: add disk sequence number To: Matthew Wilcox Cc: linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Lennart Poettering , Luca Boccassi , Jens Axboe , Alexander Viro , Damien Le Moal , Tejun Heo , =?UTF-8?Q?Javier_Gonz=C3=A1lez?= , Niklas Cassel , Johannes Thumshirn , Hannes Reinecke Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 15, 2021 at 10:05 PM Matthew Wilcox wrote: > > On Mon, Mar 15, 2021 at 08:18:24PM +0000, Matthew Wilcox wrote: > > On Mon, Mar 15, 2021 at 09:02:38PM +0100, Matteo Croce wrote: > > > From: Matteo Croce > > > > > > Add a sequence number to the disk devices. This number is put in the > > > uevent so userspace can correlate events when a driver reuses a device, > > > like the loop one. > > > > Should this be documented as monotonically increasing? I think this > > is actually a media identifier. Consider (if you will) a floppy disc. > > Back when such things were common, it was possible with personal computers > > of the era to have multiple floppy discs "in play" and be prompted to > > insert them as needed. So shouldn't it be possible to support something > > similar here -- you're really removing the media from the loop device. > > With a monotonically increasing number, you're always destroying the > > media when you remove it, but in principle, it should be possible to > > reinsert the same media and have the same media identifier number. > > So ... a lot of devices have UUIDs or similar. eg: > > $ cat /sys/block/nvme0n1/uuid > e8238fa6-bf53-0001-001b-448b49cec94f > > https://linux.die.net/man/8/scsi_id (for scsi) > Hi, I don't have uuid anywhere: matteo@saturno:~$ ll /dev/sd? brw-rw---- 1 root disk 8, 0 feb 16 13:24 /dev/sda brw-rw---- 1 root disk 8, 16 feb 16 13:24 /dev/sdb brw-rw---- 1 root disk 8, 32 feb 16 13:24 /dev/sdc brw-rw---- 1 root disk 8, 48 feb 16 13:24 /dev/sdd brw-rw---- 1 root disk 8, 64 mar 4 06:26 /dev/sde brw-rw---- 1 root disk 8, 80 feb 16 13:24 /dev/sdf matteo@saturno:~$ ll /sys/block/*/uuid ls: cannot access '/sys/block/*/uuid': No such file or directory mcroce@t490s:~$ ll /dev/nvme0n1 brw-rw----. 1 root disk 259, 0 25 mar 14.22 /dev/nvme0n1 mcroce@t490s:~$ ll /sys/block/*/uuid ls: cannot access '/sys/block/*/uuid': No such file or directory I find it only on a mdraid array: $ cat /sys/devices/virtual/block/md127/md/uuid 26117338-4f54-f14e-b5d4-93feb7fe825d I'm using a vanilla 5.11 kernel. Regards, -- per aspera ad upstream