From: NeilBrown Date: Wed, 28 Jul 2010 11:25:32 +0000 (+1000) Subject: Special files should appear to have a link-count > 0 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=ff6a4f4dec44836b9c07613d1a652f84aa42667f;p=LaFS.git Special files should appear to have a link-count > 0 otherwise they might get deleted when we put them for the last time, which would be bad. Signed-off-by: NeilBrown --- diff --git a/inode.c b/inode.c index 171c181..b7e768d 100644 --- 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);