User: Password:
|
|
Subscribe / Log in / New account

A critical look at sysfs attribute values

A critical look at sysfs attribute values

Posted Mar 19, 2010 12:22 UTC (Fri) by ranmachan (subscriber, #21283)
Parent article: A critical look at sysfs attribute values

One option to handle the bad block list would be to have 3 files:
Say, badblock_count badblock_number and badblock.
Then you read it using
for (i=0; i<badblock_count;) {
write i to badblock_number
read badblock from badblock
}
Might be quite slow though since it involves lots of context switches. :)


(Log in to post comments)

A critical look at sysfs attribute values

Posted Mar 21, 2010 0:37 UTC (Sun) by giraffedata (subscriber, #1954) [Link]

That suffers seriously from the issue mentioned in other comments of cross-file consistency. After you read the number of bad blocks, the number of them changes, and so does the identity of the 35th one.

A critical look at sysfs attribute values

Posted Mar 22, 2010 22:32 UTC (Mon) by neilbrown (subscriber, #359) [Link]

Apart from any consistency problems mentioned elsewhere, this approach really just hides the problem rather than solving it.

It still has many values behind 1 (or 3) attribute files. If the "one value per file" policy stands, it is the wrong thing to do. If the "one value per file" policy can be extended to support arbitrarily large values, then implementing that policy extension through seqfile or similar would be a much more sensible resolution.


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds