From: Andries.Brouwer@cwi.nl
To: linux-kernel@vger.kernel.org, torvalds@transmeta.com
Subject: [PATCH] swapfile.c
Date: Sat, 2 Mar 2002 21:25:16 GMT [thread overview]
Message-ID: <UTC200203022125.VAA144817.aeb@cwi.nl> (raw)
In 2.5.2 swapfile.c was broken:
In sys_swapon() we see
swap_file = filp_open(name, O_RDWR, 0);
if (IS_ERR(swap_file))
goto bad_swap_2;
bad_swap_2:
...
if (swap_file)
filp_close(swap_file, NULL);
and this oopses the kernel.
Below a trivial fix. Somebody with more time may come
back and polish stuff a little.
Andries
--- swapfile.c~ Sat Mar 2 18:23:19 2002
+++ swapfile.c Sun Mar 3 23:08:48 2002
@@ -905,8 +905,10 @@
swap_file = filp_open(name, O_RDWR, 0);
putname(name);
error = PTR_ERR(swap_file);
- if (IS_ERR(swap_file))
+ if (IS_ERR(swap_file)) {
+ swap_file = NULL;
goto bad_swap_2;
+ }
p->swap_file = swap_file;
[this was a patch relative to 2.5.6-pre2]
next reply other threads:[~2002-03-02 21:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-02 21:25 Andries.Brouwer [this message]
2002-03-04 11:28 ` [PATCH] swapfile.c Andrey Panin
2002-03-04 18:48 ` Robert Love
2002-03-04 19:14 ` Dave Jones
-- strict thread matches above, loose matches on Subject: below --
2001-06-20 0:24 [Patch] swapfile.c Nathan D. Fabian
2001-06-20 15:16 ` Nathan D. Fabian
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=UTC200203022125.VAA144817.aeb@cwi.nl \
--to=andries.brouwer@cwi.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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