* [PATCH] hugetlbfs: fix error reporting in case of invalid mount options
@ 2003-06-07 12:55 René Scharfe
2003-06-07 16:35 ` William Lee Irwin III
0 siblings, 1 reply; 4+ messages in thread
From: René Scharfe @ 2003-06-07 12:55 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel, trivial
Hi Linus,
there is not much point in trying to print the mount options after
hugetlbfs_parse_options() went over them.
Since it employs strsep(), it cuts the option string into pieces by
replacing all commas with NUL characters. A following printk() will
always show the first option, only, which could be confusing.
The patch below changes hugetlbfs to not try to echo the string of
mount options in case of an error at all. It wouldn't tell us anything
we didn't know before, anyway.
René
diff -u ./fs/hugetlbfs/inode.c~ ./fs/hugetlbfs/inode.c
--- ./fs/hugetlbfs/inode.c~ 2003-06-07 14:21:29.000000000 +0200
+++ ./fs/hugetlbfs/inode.c 2003-06-07 14:21:49.000000000 +0200
@@ -525,7 +525,7 @@
ret = hugetlbfs_parse_options(data, &config);
if (ret) {
- printk("hugetlbfs: invalid mount options: %s.\n", data);
+ printk(KERN_ERR "hugetlbfs: invalid mount options.\n");
return ret;
}
sb->s_blocksize = PAGE_CACHE_SIZE;
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] hugetlbfs: fix error reporting in case of invalid mount options
2003-06-07 12:55 [PATCH] hugetlbfs: fix error reporting in case of invalid mount options René Scharfe
@ 2003-06-07 16:35 ` William Lee Irwin III
2003-06-07 17:29 ` René Scharfe
0 siblings, 1 reply; 4+ messages in thread
From: William Lee Irwin III @ 2003-06-07 16:35 UTC (permalink / raw)
To: Ren? Scharfe; +Cc: Linus Torvalds, linux-kernel, trivial
On Sat, Jun 07, 2003 at 02:55:32PM +0200, Ren? Scharfe wrote:
> there is not much point in trying to print the mount options after
> hugetlbfs_parse_options() went over them.
> Since it employs strsep(), it cuts the option string into pieces by
> replacing all commas with NUL characters. A following printk() will
> always show the first option, only, which could be confusing.
> The patch below changes hugetlbfs to not try to echo the string of
> mount options in case of an error at all. It wouldn't tell us anything
> we didn't know before, anyway.
Let's nuke it entirely. All other fs's barf without printk()'ing at all
and kick -EINVAL back to the caller.
-- wli
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hugetlbfs: fix error reporting in case of invalid mount options
2003-06-07 16:35 ` William Lee Irwin III
@ 2003-06-07 17:29 ` René Scharfe
2003-06-07 17:16 ` William Lee Irwin III
0 siblings, 1 reply; 4+ messages in thread
From: René Scharfe @ 2003-06-07 17:29 UTC (permalink / raw)
To: William Lee Irwin III; +Cc: torvalds, linux-kernel, trivial
On Sat, 7 Jun 2003 09:35:21 -0700 William Lee Irwin III <wli@holomorphy.com> wrote:
> Let's nuke it entirely. All other fs's barf without printk()'ing at all
> and kick -EINVAL back to the caller.
Mmmkay, even better. Patch below.
René
diff -u ./fs/hugetlbfs/inode.c~ ./fs/hugetlbfs/inode.c
--- ./fs/hugetlbfs/inode.c~ 2003-06-07 19:22:27.000000000 +0200
+++ ./fs/hugetlbfs/inode.c 2003-06-07 19:23:03.000000000 +0200
@@ -524,10 +524,9 @@
struct hugetlbfs_config config;
ret = hugetlbfs_parse_options(data, &config);
- if (ret) {
- printk("hugetlbfs: invalid mount options: %s.\n", data);
+ if (ret)
return ret;
- }
+
sb->s_blocksize = PAGE_CACHE_SIZE;
sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
sb->s_magic = HUGETLBFS_MAGIC;
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] hugetlbfs: fix error reporting in case of invalid mount options
2003-06-07 17:29 ` René Scharfe
@ 2003-06-07 17:16 ` William Lee Irwin III
0 siblings, 0 replies; 4+ messages in thread
From: William Lee Irwin III @ 2003-06-07 17:16 UTC (permalink / raw)
To: Ren? Scharfe; +Cc: torvalds, linux-kernel, trivial
On Sat, 7 Jun 2003 09:35:21 -0700 William Lee Irwin III <wli@holomorphy.com> wrote:
>> Let's nuke it entirely. All other fs's barf without printk()'ing at all
>> and kick -EINVAL back to the caller.
On Sat, Jun 07, 2003 at 07:29:27PM +0200, Ren? Scharfe wrote:
> Mmmkay, even better. Patch below.
Looks good to me. Linus, please apply.
-- wli
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-06-07 17:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-07 12:55 [PATCH] hugetlbfs: fix error reporting in case of invalid mount options René Scharfe
2003-06-07 16:35 ` William Lee Irwin III
2003-06-07 17:29 ` René Scharfe
2003-06-07 17:16 ` William Lee Irwin III
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox