* [Cluster-devel] [GFS2 PATCH] GFS2: Temporarily zero i_no_addr when creating a dinode
[not found] <828605987.3167178.1489693014971.JavaMail.zimbra@redhat.com>
@ 2017-03-16 19:38 ` Bob Peterson
0 siblings, 0 replies; only message in thread
From: Bob Peterson @ 2017-03-16 19:38 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
Before this patch i_no_addr was not initialized until after the
return from allocating its block. That meant the i_no_addr was
temporarily uninitialized storage. Ordinarily that's not a concern,
but if inplace_reserve can't find space, it can call try_rgrp_unlink
which references i_no_addr as a block to avoid. That can result in
unpredictable behavior. More importantly, the trace point in
gfs2_alloc_blocks references ip->i_no_addr before it is set, which
is misleading when reading the kernel traces. This patch makes it
look like the new dinode block was assigned in the name of inode 0
rather than a random inode that's completely unrelated.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
fs/gfs2/inode.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index e279c3c..4f405d4 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -667,6 +667,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
ip->i_height = 0;
ip->i_depth = 0;
ip->i_entries = 0;
+ ip->i_no_addr = 0; /* Temporarily zero until real addr is assigned */
switch(mode & S_IFMT) {
case S_IFREG:
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-03-16 19:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <828605987.3167178.1489693014971.JavaMail.zimbra@redhat.com>
2017-03-16 19:38 ` [Cluster-devel] [GFS2 PATCH] GFS2: Temporarily zero i_no_addr when creating a dinode Bob Peterson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).