[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/gfs2/libgfs2 fs_ops.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	rpeterso sourceware org	2007-03-26 20:32:00

Modified files:
	gfs2/libgfs2   : fs_ops.c 

Log message:
	Resolves: Bugzilla Bug 232124: gfs2_fsck will create multiple
	lost+found directories.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/libgfs2/fs_ops.c.diff?cvsroot=cluster&r1=1.5&r2=1.6

--- cluster/gfs2/libgfs2/fs_ops.c	2007/02/12 18:55:29	1.5
+++ cluster/gfs2/libgfs2/fs_ops.c	2007/03/26 19:31:59	1.6
@@ -1177,19 +1177,24 @@
 	uint64_t bn;
 	struct gfs2_inum inum;
 	struct gfs2_buffer_head *bh;
+	struct gfs2_inode *ip;
 
-	bn = dinode_alloc(sdp);
+	gfs2_lookupi(dip, filename, strlen(filename), &ip);
+	if (!ip) {
+		bn = dinode_alloc(sdp);
 
-	inum.no_formal_ino = sdp->md.next_inum++;
-	inum.no_addr = bn;
+		inum.no_formal_ino = sdp->md.next_inum++;
+		inum.no_addr = bn;
 
-	dir_add(dip, filename, strlen(filename), &inum, IF2DT(mode));
+		dir_add(dip, filename, strlen(filename), &inum, IF2DT(mode));
 
-	if(S_ISDIR(mode))
-		dip->i_di.di_nlink++;
+		if(S_ISDIR(mode))
+			dip->i_di.di_nlink++;
 
-	bh = init_dinode(sdp, &inum, mode, flags, &dip->i_di.di_num);
-	return inode_get(sdp, bh);
+		bh = init_dinode(sdp, &inum, mode, flags, &dip->i_di.di_num);
+		ip = inode_get(sdp, bh);
+	}
+	return ip;
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]