[PATCH V7 2/6] mtd: partitions: remove sysfs files when deleting all master's partitions

Brian Norris computersforpeace at gmail.com
Fri Jun 23 10:57:35 PDT 2017


On Thu, Jun 22, 2017 at 11:40:47PM +0200, Rafał Miłecki wrote:
> On 22 June 2017 at 23:05, Brian Norris <computersforpeace at gmail.com> wrote:
> > Side note: this patch series sort of massages the definition of this
> > "offset" file. Now, IIUC, subpartitions will have an "offset" file
> > relative to their parent partition, not the master flash device. I'm not
> > sure which way is expected.
> 
> I didn't think about this. I should be able to easily get an absolute
> offset if needed (a simple recursion), but I'm not sure what behavior
> is actually expected. Since we use a tree struct in the sysfs now,
> maybe relative offsets are actually correct ones?

Yeah, that seems OK to me. The only holdup is that the current
description uses the term "master", where perhaps it should just mean
say "parent" now:

Documentation/ABI/testing/sysfs-class-mtd:

What:           /sys/class/mtd/mtdX/offset
Date:           March 2015
KernelVersion:  4.1
Contact:        linux-mtd at lists.infradead.org
Description:
                For a partition, the offset of that partition from the start
                of the master device in bytes. This attribute is absent on
                main devices, so it can be used to distinguish between
                partitions and devices that aren't partitions.

Brian



More information about the linux-mtd mailing list