]> git.michaelhowe.org Git - packages/o/openafs.git/commit
afs: Ensure afs_calc_inum yields nonzero ino
authorAndrew Deason <adeason@sinenomine.net>
Wed, 22 Jun 2011 18:44:38 +0000 (13:44 -0500)
committerDerrick Brashear <shadow@dementix.org>
Wed, 25 Apr 2012 10:38:38 +0000 (03:38 -0700)
commite7ea7af6573cd03859b357387a3ee666e2a6ded5
treed08734b0649349d9dcb6a27e67e12d8e425f9fbd
parent07bc098589573927d9f085773c8b06d39c8f8389
afs: Ensure afs_calc_inum yields nonzero ino

afs_calc_inum can currently yield an inode of 0 if MD5-based inode
numbers are turned on. Some userspace applications (and for some
platforms, maybe even the kernel) make certain assumptions about the
inode number for a file; in particular for example, 'ls' will not
display a file with inode 0 in a normal directory listing.

So, read the md5 digest until we get a non-zero result. Fall back to
the non-md5 calculation if we still somehow end up with a 0.

While this case may at first glance seem to be extremely rare, in
practice it can occur, as the current calculation for volume
538313506, vnode 26178 does actually yield a 0.

Reviewed-on: http://gerrit.openafs.org/4901
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 39083fe1edab784fcd75eacbdaaf7f6affa14c9f)

Change-Id: I3d06a4b5dc76934b24ced883b1985bced35c893a
Reviewed-on: http://gerrit.openafs.org/7276
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/afs/afs_util.c