diff --git a/cvmfs/cvmfs_config b/cvmfs/cvmfs_config index 32eb33446c..c2e09983d2 100755 --- a/cvmfs/cvmfs_config +++ b/cvmfs/cvmfs_config @@ -145,7 +145,7 @@ cvmfs_config_usage() { echo " stat [-v | ]" echo " status" echo " probe []" - echo " fsck []" + echo " fsck [-q(uick check for zero byte files only) | ]" echo " fuser " echo " reload [-c | ]" echo " umount" @@ -1294,9 +1294,19 @@ cvmfs_config_fsck() { continue fi - echo "CernVM-FS fsck on $dir" - cvmfs_fsck $@ $dir - retval=$(($? + $retval)) + if [ "x$1" = "x-q" ]; then + # this hardcodes the hash for the (legitimately) empty file - if anything about compression or hashing changes, + # this needs to be updated + for zeroed_file in $(find $dir -empty -wholename "$dir/[a-z0-9][a-z0-9]/*" ! -name ec3d88b62ebf526e4e5a4ff6162a3aa48a6b78); do + echo "WARNING: unexpected zero-byte file $zeroed_file - Moving it to quarantaine." + mv $zeroed_file $dir/quarantaine + retval=1 + done + else + echo "CernVM-FS fsck on $dir" + cvmfs_fsck $@ $dir + retval=$(($? + $retval)) + fi done return $retval