Re: Slow USB storage device?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 15, 2010 at 08:41:55AM -0800, Linus Torvalds wrote:
> 	[root@EeePC torvalds]# time blkid -o udev -p -u filesystem /dev/sdc1
> 	ID_FS_SEC_TYPE=msdos
> 	ID_FS_VERSION=FAT12
> 	ID_FS_TYPE=vfat
> 	ID_FS_USAGE=filesystem
> 	
> 	real	0m9.233s
> 	user	0m0.003s
> 	sys	0m0.003s
> 
> because it still does that large read:
> 
> 	read(3, "\353<\220){'`jIHC\0\2\10\1\0\2\0\2\333\3\370\1\0?\0\377\0 \0\0\0"..., 69632) = 69632
> 

 Yes, because it always reads 69kB. I'll try to fix it.

> (but then it does _not_ do the 15+ small reads at the end).
> 
> It still does two other reads:
> 
> 	_llseek(3, 270336, [270336], SEEK_SET)  = 0
> 	read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1024) = 1024

 this is zfs probing

> 	_llseek(3, 262144, [262144], SEEK_SET)  = 0
> 	read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1377) = 1377

 this is ufs probing

> I dunno what those are about. It's at about the middle of the disk. Might 
> be some vfat tables.

 The libblkid allows to restrict probing by "usage" (raid, filesystem,
 crypt, ...) or by filesystem name. The restriction by fs name is not
 exported to blkid(8) command line now. I my TODO is something like

    blkid -o udev -p -n fat,ext2,ext3 /dev/sdc1

 then it will probe for requested filesystems only.

> >  or -u noraid
> 
> Same thing. "-u noraid" seems to do exactly the same reads and seeks as 
> "-u filesystem".
> 
> >  the other way is to use -S <size> to restrict probing
> >  area. (Unfortunately, it seems that -S doesn't work now, I'll fix it
> >  asap.)
> 
> Well, I'd have to restrict it to the first few kB of the device to get rid 
> of that insane 70kB read.
> 
> You can definitely find a FAT12 filesystem in way less than 70kB.

 For example Reiser superblok could be at offset 65536.
 
 The other problem is that we always (by default) probe for all
 filesystems, because sometimes people have disks with more valid
 signatures -- we have to ignore such disks, because mount/swapon
 could be pretty dangerous.
 (http://karelzak.blogspot.com/2009_11_01_archive.html)

 Anyway, I agree that it does not make sense to probe for things like
 GFS, OCFS, RAIDs, ... on really small devices.

 I'll fix -S and remove the large 69kB read and then you can create a
 special udev rule for the device. I'm not sure if we need to change
 globally the way who udev uses blkid(8). It's first time when someone
 complains ;-)
 
 (except the stupid situation when we call blkid(8) for whole
 partitioned disk)
 
    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux