From 3cdb8dde718a6da64ba11d02774a934de40728fe Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 13 Sep 2010 17:33:54 +1000 Subject: [PATCH] Log symlink creation We cannot include it in an update, so just make sure it goes in the next write cluster. This will be before an sync or fsync and roll-forward should pick it up, so all is OK Signed-off-by: NeilBrown --- dir.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dir.c b/dir.c index 50a7374..e1555f6 100644 --- a/dir.c +++ b/dir.c @@ -904,7 +904,6 @@ abort: return err; } -/* FIXME I'm not logging the body of the symlink being created */ static int lafs_symlink(struct inode *dir, struct dentry *de, const char *symlink) @@ -956,6 +955,7 @@ retry: LAFSI(ino)->md.file.parent = dir->i_ino; lafs_add_orphan(fs, inodb); + lafs_iolock_block(&b->b); buf = map_dblock(b); memcpy(buf, symlink, l); buf[l] = 0; @@ -963,6 +963,8 @@ retry: set_bit(B_Valid, &b->b.flags); lafs_dirty_dblock(b); clear_bit(B_PinPending, &b->b.flags); + lafs_cluster_allocate(&b->b, 0); /* Content will go in the next cluster - almost like + * an update */ putdref(b, MKREF(symlink)); i_size_write(ino, l); lafs_dirty_inode(ino); -- 2.39.5