lkml.org 
[lkml]   [2014]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ntfs: avoid incorrectly release for root inode in fill_super
Date
In d_make_root, when we fail to allocate dentry for root inode, we will iput
root inode in this function.
So we do not need to release this inode again at d_make_root's caller.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
---
fs/ntfs/super.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
index 6c3296e..99c5cc6 100644
--- a/fs/ntfs/super.c
+++ b/fs/ntfs/super.c
@@ -2975,7 +2975,11 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent)
vol->secure_ino = NULL;
}
}
- iput(vol->root_ino);
+
+ /*
+ * Just set NULL value here because we have already iput root_ino
+ * in d_make_root.
+ */
vol->root_ino = NULL;
iput(vol->lcnbmp_ino);
vol->lcnbmp_ino = NULL;
--
2.0.1.474.g72c7794



\
 
 \ /
  Last update: 2014-07-25 05:01    [W:0.041 / U:0.128 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site