Kern Sibbald writes: 

> There is no such think as a hardlink.  There is a hardlink operation.  It is 
> very different from a softlink, and if you think about them the same way, you 
> will never get it right.  Two files that are hardlinked (really poor 
> terminology) *are* one and the same file.  The two files share the same 
> inode, so there is no "hardlink" with separate attributes that points to an 
> inode (as is the case for a softlink, which is a pointer).   For hardlinked 
> files, there is only one set of data and one set of attributes. 
> 

I think here is a misunderstanding because that was exactly
what I was trying to say? There are only "hardlinks" and
"softlinks" in UNIX. There is no difference between a "file"
and a "hardlink" it is technically the same - a pointer
to an inode nothing more or less. "regular files" are
always "hardlinks" in UNIX(-like systems). 

> Ideally as I mentioned above, the attributes are only kept with the data and 
> thus are only set one time.

Which is not the case in bacula. It tries to set attributes
for all "files" it restores. So it handles setting attributes
for each file. Even if it is just another pointer to the same
inode already processed. In FreeBSDs restore, At first the
attributs are set for the inodes, and after that the hardlinks
which are pointing to the inodes are created. So there is no
double (or more) setting of the same attributes over and over
like it is the case in bacula.
This can easly be fixed in bacula by setting the attributes
only once:
  for the "regular file" (1st hardlink to an inode) the
  attributes are set. All other - later - hardlinks
  (FT_LNKSAVED) ignore their stored attributes because
  the inode attributes are already set by the 1st hard-
  link. 

> Then when a second filename is found it would 
> simply be hardlinked to the first file (i.e. become one and the same) and it 
> would not then be necessary to re-set the attributes.  If this is what your 
> patch does, then it is probably OK.

That is what the patch does. Sets the attributes for the 1st
"hardlink" (type != FT_LNKSAVE) and ignores setting attributes
for all other "hardlinks" to the same inode (type == FT_LNKSAVE). 


Greetings, Oliver

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to