* [Cluster-devel] GFS2: Fix nlink setting on inode creation
@ 2012-01-11 13:10 Steven Whitehouse
0 siblings, 0 replies; only message in thread
From: Steven Whitehouse @ 2012-01-11 13:10 UTC (permalink / raw)
To: cluster-devel.redhat.com
From 66ad863b410efb7f537719006f9ac52400c1a5c5 Mon Sep 17 00:00:00 2001
From: Steven Whitehouse <swhiteho@redhat.com>
Date: Wed, 11 Jan 2012 12:35:05 +0000
Subject: [PATCH] GFS2: Fix nlink setting on inode creation
Since the nlink count will be 0, we need to use set_nlink rather
than inc_nlink in order to avoid triggering the inc_nlink warning
which was added recently.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 017960c..a7d611b 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -599,9 +599,7 @@ static int link_dinode(struct gfs2_inode *dip, const struct qstr *name,
error = gfs2_meta_inode_buffer(ip, &dibh);
if (error)
goto fail_end_trans;
- inc_nlink(&ip->i_inode);
- if (S_ISDIR(ip->i_inode.i_mode))
- inc_nlink(&ip->i_inode);
+ set_nlink(&ip->i_inode, S_ISDIR(ip->i_inode.i_mode) ? 2 : 1);
gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(ip, dibh->b_data);
brelse(dibh);
--
1.7.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-01-11 13:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-11 13:10 [Cluster-devel] GFS2: Fix nlink setting on inode creation Steven Whitehouse
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).