blkid code in pvfs

Alexander Bokovoy ab at samba.org
Fri Jul 15 05:43:26 GMT 2005


On Fri, Jul 15, 2005 at 10:45:07AM +1000, tridge at samba.org wrote:
> Alexander,
> 
> I've been having a look at your BLKID code in the posix vfs
> backend. Sorry its taken me so long to review this.
> 
> In case you've forgotten, see this patch:
> 
>   http://build.samba.org/build.pl?function=diff;tree=samba4;revision=6597
> 
> The main problem with your patch is it puts all the logic inline,
> using #ifdef. That makes the code much less readable than it was
> before. It also doesn't scale - if each info level was written like
> that then the code would quickly turn into spaghetti :-)
Agreed.
 
> Could I suggest that you create a separate pvfs_blkid.c module? The
> qfsinfo code would then do this:
> 
> 	case RAW_QFS_OBJECTID_INFORMATION:
> 		return pvfs_objectid_information(pvfs, &fs->objectid_information);
> 
> and in pvfs_blkid.c you would create a fake objectid based on the
> device and inode of the root directory of the share if blkids are not
> available, otherwise make the blkid_ call to get the information.
Yes, I'll do it.
 
> Next, is the blkid cache really needed? How slow is it to fetch this
> information (how many microseconds)? How often do clients make this
> call? A cache can be a wonderful thing when needed, but if its not
> needed then it just complicates code for no reason. We should not put
> in caches unless they are really needed (also, too many caches
> actually makes code slower, not faster).
According to libblkid documentation:

"In  situations  where  one  is getting information about a single known
device, it does not impact performance whether the cache is used or not
(unless  you  are  not able to read the block device directly).  If you
are dealing with multiple devices use of the  cache is  highly  recom-
mended (even if empty) as devices will be scanned at most one time, and
the on-disk cache will be updated if possible.  There is rarely a  rea-
son not to use the cache."

"In  some  cases  (modular kernels), block devices are not even visible
until after they are accessed the first time, so it is  critical  that
there is some way to locate these devices without enumerating only vis-
ible devices, so the use of the cache file is required in this situa-
tion."

Modular kernels are regular nowadays so it is makes little sense to skip
the cache, especially taking into account accesses to slow media (like
encrypted block devices or usb devices).
									     
> 
> In testing, it seems that current w2k3 servers don't support this call
> at all, or at least mine don't, so it seems unlikely that clients would
> call it very often. Have you seen it a lot?
Windows XP has it but as your further tests with w2k3 show w2k3 responds
with NT_STATUS_OBJECT_NAME_NOT_FOUND which means that probably we have IDL
wrong in the case and Windows XP does not care. 

I'll try to work that IDL out in a near time once I get back to home in a
week.

-- 
/ Alexander Bokovoy
Samba Team                      http://www.samba.org/
ALT Linux Team                  http://www.altlinux.org/
Midgard Project Ry              http://www.midgard-project.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20050715/04564875/attachment.bin


More information about the samba-technical mailing list