Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1681665
| From | Kees Cook <keescook@chromium.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 04/14] pstore: Implement show_options |
| Date | 2017-07-05 19:20 +0200 |
| Message-ID | <tZW82-JF-11@gated-at.bofh.it> (permalink) |
| References | <tZUpz-83i-3@gated-at.bofh.it> <tZUpA-83i-35@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Jul 5, 2017 at 8:24 AM, David Howells <dhowells@redhat.com> wrote:
> Implement the show_options superblock op for pstore as part of a bid to get
> rid of s_options and generic_show_options() to make it easier to implement
> a context-based mount where the mount options can be passed individually
> over a file descriptor.
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: Kees Cook <keescook@chromium.org>
> cc: Anton Vorontsov <anton@enomsg.org>
> cc: Colin Cross <ccross@android.com>
> cc: Tony Luck <tony.luck@intel.com>
Acked-by: Kees Cook <keescook@chromium.org>
Do you want me to take this into the pstore tree or do you want to
push it via a separate tree?
-Kees
> ---
>
> fs/pstore/inode.c | 14 +++++++++++---
> fs/pstore/internal.h | 3 +++
> fs/pstore/platform.c | 2 +-
> 3 files changed, 15 insertions(+), 4 deletions(-)
>
> diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c
> index 792a4e5f9226..913e839ac1f5 100644
> --- a/fs/pstore/inode.c
> +++ b/fs/pstore/inode.c
> @@ -283,6 +283,16 @@ static void parse_options(char *options)
> }
> }
>
> +/*
> + * Display the mount options in /proc/mounts.
> + */
> +static int pstore_show_options(struct seq_file *m, struct dentry *root)
> +{
> + if (kmsg_bytes != PSTORE_DEFAULT_KMSG_BYTES)
> + seq_printf(m, ",kmsg_bytes=%lu", kmsg_bytes);
> + return 0;
> +}
> +
> static int pstore_remount(struct super_block *sb, int *flags, char *data)
> {
> sync_filesystem(sb);
> @@ -296,7 +306,7 @@ static const struct super_operations pstore_ops = {
> .drop_inode = generic_delete_inode,
> .evict_inode = pstore_evict_inode,
> .remount_fs = pstore_remount,
> - .show_options = generic_show_options,
> + .show_options = pstore_show_options,
> };
>
> static struct super_block *pstore_sb;
> @@ -448,8 +458,6 @@ static int pstore_fill_super(struct super_block *sb, void *data, int silent)
> {
> struct inode *inode;
>
> - save_mount_options(sb, data);
> -
> pstore_sb = sb;
>
> sb->s_maxbytes = MAX_LFS_FILESIZE;
> diff --git a/fs/pstore/internal.h b/fs/pstore/internal.h
> index c416e653dc4f..4d5913130580 100644
> --- a/fs/pstore/internal.h
> +++ b/fs/pstore/internal.h
> @@ -5,6 +5,9 @@
> #include <linux/time.h>
> #include <linux/pstore.h>
>
> +#define PSTORE_DEFAULT_KMSG_BYTES 10240
> +extern unsigned long kmsg_bytes;
> +
> #ifdef CONFIG_PSTORE_FTRACE
> extern void pstore_register_ftrace(void);
> extern void pstore_unregister_ftrace(void);
> diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
> index d468eec9b8a6..6640df40908d 100644
> --- a/fs/pstore/platform.c
> +++ b/fs/pstore/platform.c
> @@ -99,7 +99,7 @@ static char *big_oops_buf;
> static size_t big_oops_buf_sz;
>
> /* How much of the console log to snapshot */
> -static unsigned long kmsg_bytes = 10240;
> +unsigned long kmsg_bytes = PSTORE_DEFAULT_KMSG_BYTES;
>
> void pstore_set_kmsg_bytes(int bytes)
> {
>
--
Kees Cook
Pixel Security
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC][PATCH 00/14] VFS: Make all filesystems implement ->show_options() David Howells <dhowells@redhat.com> - 2017-07-05 17:30 +0200
[PATCH 11/14] isofs: Implement show_options David Howells <dhowells@redhat.com> - 2017-07-05 17:30 +0200
[PATCH] isofs: Fix isofs_show_options() David Howells <dhowells@redhat.com> - 2017-07-11 17:30 +0200
[PATCH 04/14] pstore: Implement show_options David Howells <dhowells@redhat.com> - 2017-07-05 17:30 +0200
Re: [PATCH 04/14] pstore: Implement show_options Kees Cook <keescook@chromium.org> - 2017-07-05 19:20 +0200
Re: [PATCH 04/14] pstore: Implement show_options David Howells <dhowells@redhat.com> - 2017-07-07 18:10 +0200
[PATCH 07/14] spufs: Implement show_options David Howells <dhowells@redhat.com> - 2017-07-05 17:30 +0200
[PATCH 10/14] afs: Implement show_options David Howells <dhowells@redhat.com> - 2017-07-05 17:30 +0200
[PATCH 08/14] befs: Implement show_options David Howells <dhowells@redhat.com> - 2017-07-05 17:30 +0200
[PATCH 06/14] bpf: Implement show_options David Howells <dhowells@redhat.com> - 2017-07-05 17:30 +0200
Re: [PATCH 06/14] bpf: Implement show_options Daniel Borkmann <daniel@iogearbox.net> - 2017-07-06 10:10 +0200
Re: [RFC][PATCH 00/14] VFS: Make all filesystems implement ->show_options() ebiederm@xmission.com (Eric W. Biederman) - 2017-07-05 18:50 +0200
Re: [RFC][PATCH 00/14] VFS: Make all filesystems implement ->show_options() David Howells <dhowells@redhat.com> - 2017-07-07 18:00 +0200
Re: [RFC][PATCH 00/14] VFS: Make all filesystems implement ->show_options() Theodore Ts'o <tytso@mit.edu> - 2017-07-08 17:40 +0200
csiph-web