Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP4
nfs-utils
0021-mount.nfs-insert-sloppy-at-beginning-of-th...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0021-mount.nfs-insert-sloppy-at-beginning-of-the-options.patch of Package nfs-utils
From 92b664ef4f25f1bd920bea4db435345629543353 Mon Sep 17 00:00:00 2001 From: Jianhong Yin <yin-jianhong@163.com> Date: Thu, 10 Jun 2021 13:27:29 -0400 Subject: [PATCH] mount.nfs: insert 'sloppy' at beginning of the options Previously, the 'sloppy' option was appended to other options so that when kernel parses the options sequentially, the 'sloppy' option will not work if there's a invalid option in front of it. use 'po_insert' instead 'po_append' Signed-off-by: Jianhong Yin <yin-jianhong@163.com> Signed-off-by: Steve Dickson <steved@redhat.com> --- utils/mount/parse_opt.c | 33 +++++++++++++++++++++++++++++++++ utils/mount/parse_opt.h | 1 + utils/mount/stropts.c | 6 +++--- 3 files changed, 37 insertions(+), 3 deletions(-) --- a/utils/mount/parse_opt.c +++ b/utils/mount/parse_opt.c @@ -178,6 +178,22 @@ static void options_tail_insert(struct m options->count++; } +static void options_head_insert(struct mount_options *options, + struct mount_option *option) +{ + struct mount_option *ohead = options->head; + + option->prev = NULL; + option->next = ohead; + if (ohead) + ohead->prev = option; + else + options->tail = option; + options->head = option; + + options->count++; +} + static void options_delete(struct mount_options *options, struct mount_option *option) { @@ -374,6 +390,23 @@ po_return_t po_join(struct mount_options } /** + * po_insert - insert an option into a group of options + * @options: pointer to mount options + * @option: pointer to a C string containing the option to add + * + */ +po_return_t po_insert(struct mount_options *options, char *str) +{ + struct mount_option *option = option_create(str); + + if (option) { + options_head_insert(options, option); + return PO_SUCCEEDED; + } + return PO_FAILED; +} + +/** * po_append - concatenate an option onto a group of options * @options: pointer to mount options * @option: pointer to a C string containing the option to add --- a/utils/mount/parse_opt.h +++ b/utils/mount/parse_opt.h @@ -43,6 +43,7 @@ void po_replace(struct mount_options * struct mount_options *); po_return_t po_join(struct mount_options *, char **); +po_return_t po_insert(struct mount_options *, char *); po_return_t po_append(struct mount_options *, char *); po_found_t po_contains(struct mount_options *, char *); po_found_t po_contains_prefix(struct mount_options *options, --- a/utils/mount/stropts.c +++ b/utils/mount/stropts.c @@ -300,12 +300,12 @@ static int nfs_verify_lock_option(struct return 1; } -static int nfs_append_sloppy_option(struct mount_options *options) +static int nfs_insert_sloppy_option(struct mount_options *options) { if (!sloppy || linux_version_code() < MAKE_VERSION(2, 6, 27)) return 1; - if (po_append(options, "sloppy") == PO_FAILED) + if (po_insert(options, "sloppy") == PO_FAILED) return 0; return 1; } @@ -389,7 +389,7 @@ static int nfs_validate_options(struct n if (!nfs_set_version(mi)) return 0; - if (!nfs_append_sloppy_option(mi->options)) + if (!nfs_insert_sloppy_option(mi->options)) return 0; return 1;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor