gboudreau/Greyhole — Issue #56: fsck should check that file copies are NOT symlinks
Author: gboudreau
Created: 2012-02-23 16:13:22+00:00
State: open

Example --debug output for a file copy that is a symlink.

```
Debugging file operations for file named "Yes Man/Yes Man.avi"

...
From DB
=======
[2012-01-28 17:49:51] Task ID 27109: fsck_file Films/Yes Man/Yes Man.avi

From logs
=========
Feb 20 22:48:58 7 fsck: Saving metadata in /var/hda/files/drives/drive2/gh/.gh_metastore/Films/Yes Man/Yes Man.nfo
Feb 20 22:48:58 7 fsck: Found /var/hda/files/drives/drive1/gh/Films/Yes Man/Yes Man.avi
Feb 20 22:48:58 7 fsck: Found /var/hda/files/drives/drive2/gh/Films/Yes Man/Yes Man.avi
Feb 20 22:48:58 7 fsck: Loading metafiles for Films/Yes Man/Yes Man.avi ...
Feb 20 22:48:58 7 fsck: Got 2 metadata files.
Feb 20 22:48:58 6 fsck: Missing file copies. Expected 2, got 1. Will create more copies using /var/hda/files/drives/drive1/gh/Films/Yes Man/Yes Man.avi
Feb 20 22:48:58 7 fsck: Updating symlink at /var/LZ/Films/Yes Man/Yes Man.avi to point to /var/hda/files/drives/drive1/gh/Films/Yes Man/Yes Man.avi
Feb 20 22:48:58 7 fsck: Saving 2 metadata files for Films/Yes Man/Yes Man.avi
Feb 20 22:48:58 7 fsck: Saving metadata in /var/hda/files/drives/drive1/gh/.gh_metastore/Films/Yes Man/Yes Man.avi
Feb 20 22:48:58 7 fsck: Saving metadata in /var/hda/files/drives/drive2/gh/.gh_metastore/Films/Yes Man/Yes Man.avi
Feb 20 22:48:58 7 fsck: Starting metastores fsck for /Films/Yes Man

From filesystem
===============
Landing Zone:
lrwxrwxrwx 1 root root 57 Feb 20 22:48 /var/LZ/Films/Yes Man/Yes Man.avi -> /var/hda/files/drives/drive1/gh/Films/Yes Man/Yes Man.avi

Metadata Store:
-rwxrwxrwx 1 TertiaryAdjunct users 286 Feb 20 22:48 /var/hda/files/drives/drive1/gh/.gh_metastore/Films/Yes Man/Yes Man.avi
array (
0 =>
stdClass::__set_state(array(
'path' => '/var/hda/files/drives/drive1/gh/Films/Yes Man/Yes Man.avi',
'is_linked' => true,
'state' => 'OK',
)),
1 =>
stdClass::__set_state(array(
'path' => '/var/hda/files/drives/drive2/gh/Films/Yes Man/Yes Man.avi',
'is_linked' => false,
'state' => 'OK',
)),
)
-rw-rw-rw- 1 root root 286 Feb 20 22:48 /var/hda/files/drives/drive2/gh/.gh_metastore/Films/Yes Man/Yes Man.avi
array (
0 =>
stdClass::__set_state(array(
'path' => '/var/hda/files/drives/drive1/gh/Films/Yes Man/Yes Man.avi',
'is_linked' => true,
'state' => 'OK',
)),
1 =>
stdClass::__set_state(array(
'path' => '/var/hda/files/drives/drive2/gh/Films/Yes Man/Yes Man.avi',
'is_linked' => false,
'state' => 'OK',
)),
)

File copies:
-rwxrwxrwx 1 TertiaryAdjunct users 734025728 Jan 24 21:21 /var/hda/files/drives/drive1/gh/Films/Yes Man/Yes Man.avi
lrwxrwxrwx 1 TertiaryAdjunct users 57 Jan 26 03:46 /var/hda/files/drives/drive2/gh/Films/Yes Man/Yes Man.avi -> /var/hda/files/drives/drive1/gh/Films/Yes Man/Yes Man.avi
```