Thread (19 messages) 19 messages, 4 authors, 2012-02-07
STALE5269d

[PATCH 5/8] xfsprogs: Drop root inode refrerence in libxfs_umount()

From: Alex Elder <hidden>
Date: 2011-11-10 20:35:40
Subsystem: the rest · Maintainer: Linus Torvalds

From: Kevan Rehm <redacted>

Routine libxfs_umount() did not call libxfs_iput for the m_rootip
inode, so updates made to that inode could be lost.  This adds the
missing call, and re-initializes the m_rootip pointer to be null.

Since the root inode reference is now dropped by libxfs_umount(), it
should *not* be dropped in mkfs parseproto().

Signed-off-by: Alex Elder <redacted>
---
 libxfs/init.c |    4 ++++
 mkfs/proto.c  |    3 ++-
 2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/libxfs/init.c b/libxfs/init.c
index ba44c9b..d34fd8c 100644
--- a/libxfs/init.c
+++ b/libxfs/init.c
@@ -816,6 +816,10 @@ libxfs_umount(xfs_mount_t *mp)
 	int			agno;
 
 	libxfs_rtmount_destroy(mp);
+	if (mp->m_rootip) {
+		libxfs_iput(mp->m_rootip, 0);
+		mp->m_rootip = NULL;
+	}
 	libxfs_icache_purge();
 	libxfs_bcache_purge();
 
diff --git a/mkfs/proto.c b/mkfs/proto.c
index 3021028..3f76862 100644
--- a/mkfs/proto.c
+++ b/mkfs/proto.c
@@ -571,7 +571,8 @@ parseproto(
 				break;
 			parseproto(mp, ip, fsxp, pp, name);
 		}
-		libxfs_iput(ip, 0);
+		if (!isroot)
+			libxfs_iput(ip, 0);
 		return;
 	}
 	libxfs_trans_log_inode(tp, ip, flags);
-- 
1.7.6.4

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help