]> git.neil.brown.name Git - LaFS.git/commitdiff
Special files should appear to have a link-count > 0
authorNeilBrown <neilb@suse.de>
Wed, 28 Jul 2010 11:25:32 +0000 (21:25 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 9 Aug 2010 01:58:12 +0000 (11:58 +1000)
otherwise they might get deleted when we put them for
the last time, which would be bad.

Signed-off-by: NeilBrown <neilb@suse.de>
inode.c

diff --git a/inode.c b/inode.c
index 171c1818465c673154d147c2e32d47cb656f52d6..b7e768d73d28932479908e6862ab8d099f1ed9c8 100644 (file)
--- a/inode.c
+++ b/inode.c
@@ -219,6 +219,9 @@ lafs_import_inode(struct inode *ino, struct datablock *b)
        }
 
        ino->i_mode = S_IFREG;
+       ino->i_nlink = 1; /* For special file, set nlink so they
+                          * never appear unlinked */
+
        err = -EINVAL;
 
        LAFS_BUG(ino->i_ino != b->b.fileaddr, &b->b);