From: Chao Yu <chao2.yu@samsung.com>
To: anton@tuxera.com
Cc: linux-ntfs-dev@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: [PATCH] ntfs: avoid incorrectly release for root inode in fill_super
Date: Fri, 25 Jul 2014 10:25:10 +0800 [thread overview]
Message-ID: <002901cfa7af$c2024dc0$4606e940$@samsung.com> (raw)
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
next reply other threads:[~2014-07-25 2:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-25 2:25 Chao Yu [this message]
2014-07-25 7:47 ` Anton Altaparmakov
2014-07-25 8:54 ` Chao Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='002901cfa7af$c2024dc0$4606e940$@samsung.com' \
--to=chao2.yu@samsung.com \
--cc=anton@tuxera.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-ntfs-dev@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®