Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fuse, meta: make fuse options adjustable via .meta #2891

Closed
wants to merge 1 commit into from

Conversation

csabahenk
Copy link
Member

@csabahenk csabahenk commented Oct 20, 2021

The .meta synthetic tree features the options entry
for each xlator, which lets us see the options with
which the translator was configured. Technically,
'options' exports the options dict with which the
given xlator has been configured. This approach
provides read-only access to the xlator options,
and only those options are visible which has been
set.

We implement an alternative options entry (referred
to as 'aadjustable options' in the sequel) that
exports the full option set of the xlator. We
extended the volume_options stucture wih 'fetch'
and 'update' methods, that facilitate access to
the realtime values of the xlator options. In
the adjustable options dict each option is readable
which has 'fetch' and if they have 'update' too,
then they shall be writable (this is properly
reflected in file modes since 2554080).

While the dict-based options is generic and provides
an export mechanism for xlator options without specific
support from the xlators, adjustable options will export
only those options for which the xlator implements
fetch/update.

We made this effort for the fuse xlator, which is positioned
in glusterfs client as the root of the xlator tree, and thus
can't be 'hot-swapped' like other xlators via graph switch.

All the fuse options obained 'fetch'; and the ones where
runtime update is possible also 'update' (ie. those which
control the internal behavior of the filesystem server, can
be updated; the ones which are mount options or init options
for the FUSE infrastucture, can't).

Change-Id: I72cb0f3c2f93712cd08147a4ae2e076354d8d9d8
Fixes: #1785
Signed-off-by: Csaba Henk csaba@redhat.com

Copy link
Member

@amarts amarts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@csabahenk overall this looks good. Is it possible to add a test case for testing this feature?

xlators/meta/src/meta-helpers.c Outdated Show resolved Hide resolved
xlators/meta/src/meta-helpers.c Outdated Show resolved Hide resolved
xlators/meta/src/meta.h Outdated Show resolved Hide resolved
xlators/meta/src/option-file.c Outdated Show resolved Hide resolved
xlators/meta/src/option-file.c Outdated Show resolved Hide resolved
xlators/meta/src/option-file.c Outdated Show resolved Hide resolved
xlators/meta/src/options-dir.c Outdated Show resolved Hide resolved
xlators/meta/src/xlator-dir.c Show resolved Hide resolved
Comment on lines +58 to +60
TUN_LOCK(priv);
fopen_keep_cache = priv->fopen_keep_cache;
TUN_UNLOCK(priv);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes no sense to use a mutex just to load a flag. An atomic load should be enough. As soon as we leave the mutex, the value may have changed, so the potential races on the following code are the same as using the atomic.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I'll consult you how to go about this.

xlators/mount/fuse/src/fuse-bridge.c Show resolved Hide resolved
@csabahenk
Copy link
Member Author

csabahenk commented Nov 27, 2021

@csabahenk overall this looks good. Is it possible to add a test case for testing this feature?

@amarts The latest revision includes the test case.

@csabahenk csabahenk force-pushed the issue1785 branch 2 times, most recently from 4bdc651 to bf1f312 Compare November 30, 2021 06:17
The .meta synthetic tree features the options entry
for each xlator, which lets us see the options with
which the translator was configured. Technically,
'options' exports the options dict with which the
given xlator has been configured. This approach
provides read-only access to the xlator options,
and only those options are visible which has been
set.

We implement an alternative options entry (referred
to as 'adjustable options' in the sequel) that
exports the full option set of the xlator. We
extended the volume_options stucture wih 'fetch'
and 'update' methods, that facilitate access to
the realtime values of the xlator options. In
the adjustable options dict each option is readable
which has 'fetch' and if they have 'update' too,
then they shall be writable (this is properly
reflected in file modes since 2554080).

While the dict-based options is generic and provides
an export mechanism for xlator options without specific
support from the xlators, adjustable options will export
only those options for which the xlator implements
fetch/update.

We made this effort for the fuse xlator, which is positioned
in glusterfs client as the root of the xlator tree, and thus
can't be 'hot-swapped' like other xlators via graph switch.

All the fuse options obained 'fetch'; and the ones where
runtime update is possible also 'update' (ie. those which
control the internal behavior of the filesystem server, can
be updated; the ones which are mount options or init options
for the FUSE infrastucture, can't).

Change-Id: I72cb0f3c2f93712cd08147a4ae2e076354d8d9d8
Fixes: gluster#1785
Signed-off-by: Csaba Henk <csaba@redhat.com>
@stale
Copy link

stale bot commented Jul 10, 2022

Thank you for your contributions.
Noticed that this issue is not having any activity in last ~6 months! We are marking this issue as stale because it has not had recent activity.
It will be closed in 2 weeks if no one responds with a comment here.

@stale stale bot added the wontfix Managed by stale[bot] label Jul 10, 2022
@stale
Copy link

stale bot commented Jul 30, 2022

Closing this issue as there was no update since my last update on issue. If this is an issue which is still valid, feel free to open it.

@stale stale bot closed this Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release 11 wontfix Managed by stale[bot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFE: setting per-mount options via .meta
6 participants