diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2011-10-28 08:13:30 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@serles.lst.de> | 2011-11-02 07:53:43 -0400 |
commit | a78ef704a8dd430225955f0709b22d4a6ba21deb (patch) | |
tree | ebd8f8a5a257077912b7cc38ecfdab43e1d7d73d /fs/inode.c | |
parent | bfe8684869601dacfcb2cd69ef8cfd9045f62170 (diff) |
vfs: protect i_nlink
Prevent direct modification of i_nlink by making it const and adding a
non-const __i_nlink alias.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Tested-by: Toshiyuki Okajima <toshi.okajima@jp.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/inode.c')
-rw-r--r-- | fs/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/inode.c b/fs/inode.c index ecbb68dc7e2a..ee4e66b998f4 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -142,7 +142,7 @@ int inode_init_always(struct super_block *sb, struct inode *inode) | |||
142 | atomic_set(&inode->i_count, 1); | 142 | atomic_set(&inode->i_count, 1); |
143 | inode->i_op = &empty_iops; | 143 | inode->i_op = &empty_iops; |
144 | inode->i_fop = &empty_fops; | 144 | inode->i_fop = &empty_fops; |
145 | inode->i_nlink = 1; | 145 | inode->__i_nlink = 1; |
146 | inode->i_opflags = 0; | 146 | inode->i_opflags = 0; |
147 | inode->i_uid = 0; | 147 | inode->i_uid = 0; |
148 | inode->i_gid = 0; | 148 | inode->i_gid = 0; |