From: Jeff Layton <jlayton@redhat.com>
To: viro@ZenIV.linux.org.uk
Cc: linux-fsdevel@vger.kernel.org, sandeen@redhat.com
Subject: [PATCH] vfs: set s_type in alloc_super()
Date: Tue, 29 Jan 2013 19:16:11 -0500 [thread overview]
Message-ID: <1359504971-20153-1-git-send-email-jlayton@redhat.com> (raw)
I see no reason to wait until after the "set" operation returns to set
the s_type. We do call destroy_super() in some cases with that value
unset. That seems to be OK in almost all cases, but we had a fire-drill
recently with some RHEL-only patches that oopsed because the s_type was
unset when destroy_super() got called.
Move the setting of the s_type into alloc_super() as a defensive coding
measure.
Cc: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
fs/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/super.c b/fs/super.c
index 12f1237..080d60f 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -218,6 +218,7 @@ static struct super_block *alloc_super(struct file_system_type *type, int flags)
s->s_shrink.seeks = DEFAULT_SEEKS;
s->s_shrink.shrink = prune_super;
s->s_shrink.batch = 1024;
+ s->s_type = type;
}
out:
return s;
@@ -487,7 +488,6 @@ retry:
destroy_super(s);
return ERR_PTR(err);
}
- s->s_type = type;
strlcpy(s->s_id, type->name, sizeof(s->s_id));
list_add_tail(&s->s_list, &super_blocks);
hlist_add_head(&s->s_instances, &type->fs_supers);
--
1.7.11.7
next reply other threads:[~2013-01-30 0:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-30 0:16 Jeff Layton [this message]
2013-01-30 15:08 ` [PATCH] vfs: set s_type in alloc_super() Al Viro
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=1359504971-20153-1-git-send-email-jlayton@redhat.com \
--to=jlayton@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=sandeen@redhat.com \
--cc=viro@ZenIV.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).