summaryrefslogtreecommitdiffstats
path: root/src/ceph_fuse.cc (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ceph_fuse: make it to force invalidating dentries when kernel >=3.18Xiubo Li2023-01-301-6/+2
| | | | | | | | | | | The remount will fail randomly for unknown reasons. And in certain circumstance we can reprodce this very easy, which will block our testing. Make it posible to force to old method to invalidate the dcache when the "client_try_dentry_invalidate" option is enabled even kernel version >= 3.18.0 Fixes: https://tracker.ceph.com/issues/56532 Signed-off-by: Xiubo Li <xiubli@redhat.com>
* ceph_fuse: retry the test_dentry_handling if failsXiubo Li2023-01-301-3/+14
| | | | | | | | For some unknown reason the remount will fail, we need to retry it for the test_dentry_handling. Fixes: https://tracker.ceph.com/issues/56532 Signed-off-by: Xiubo Li <xiubli@redhat.com>
* ceph-fuse: perform cleanup if test_dentry_handling failedNikhilkumar Shelke2022-02-031-1/+6
| | | | | | | | | | | If remount failed due to some reason then ceph_abort() is getting called which causes child process termination without cleanup. To fix this issue, ceph_abort() call moved after performing cleanup. Fixes: https://tracker.ceph.com/issues/54049 Signed-off-by: Nikhilkumar Shelke <nshelke@redhat.com>
* common: modify 'main()s' to use new argv_to_vec() signatureRonen Friedman2021-08-191-2/+1
| | | | | | | A followup to PR #42820 that modified argv_to_vec() signature (for style and performance). Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
* ceph_fuse: build without "using namespace std"Kefu Chai2021-08-131-0/+2
| | | | | | | | | | * add "std::" prefix in headers * add "using" declarations in .cc files. so we don't rely on "using namespace std" in one or more included headers. Signed-off-by: Kefu Chai <kchai@redhat.com>
* global: reexpand the conf meta in all the child processesXiubo Li2020-11-231-2/+1
| | | | | | | | | | Especially for the tools or the daemons whose config options need to expand the '$pid', they will be always expanded with the parent processes. We need to reexpand them in child processes just after the fork is done. Fixes: https://tracker.ceph.com/issues/48240 Signed-off-by: Xiubo Li <xiubli@redhat.com>
* ceph-fuse: show fuse helper options for libfuse >= 3.0Xiubo Li2020-07-081-1/+9
| | | | | | | Since libfuse 3.0 the fuse_parse_cmdline have remove the showing of usage, we must call the helper ourself. Signed-off-by: Xiubo Li <xiubli@redhat.com>
* fuse: update to newer FUSE_USE_VERSIONJeff Layton2020-06-031-2/+1
| | | | | | | | | | | | | | | | | | The build was failing for me against fuse-devel v3.9.1. The prototype for fuse_ll_ioctl was wrong, as it was expecting the old-style one with signed int args. In newer libfuse versions, the prototype varies based on FUSE_USE_VERSION. Update to a newer FUSE_USE_VERSION value to ensure that we use the newer ioctl prototype. This also means that we need to handle a new prototype for fuse_session_loop_mt as well. While we're in here, move the definition of FUSE_USE_VERSION to ceph_fuse.h so we have the definition in one place. This does mean we need to reorganize the includes in a few places. Fixes: https://tracker.ceph.com/issues/45866 Signed-off-by: Jeff Layton <jlayton@redhat.com>
* libfuse: check the libfuse version from the pkconfig/fuse{3}.pc fileXiubo Li2020-05-251-0/+1
| | | | | | | | | | | | | Since libfuse 3.2 to 3.8 the minor version for FUSE library has stopped updating together with the releases. So we cannot check version by using the FUSE_VERSION macro in the fuse_common.h header file directly. This will check the major/minor version from the fuse{3}.pc pkconfig file. Fixes: https://tracker.ceph.com/issues/45396 Signed-off-by: Xiubo Li <xiubli@redhat.com>
* osdc: Asiofact the ObjecterAdam C. Emerson2020-05-151-1/+1
| | | | | | | | Thanks to Casey Bodley <cbodley@users.noreply.github.com> for watch/notify fixes and Patrick Donnelly <pdonnell@redhat.com> for MDS fix. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
* monc: Asifoact MonClientAdam C. Emerson2020-05-151-1/+7
| | | | | | Of course now everyone has to feed an io_context into the MonClient. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
* ceph-fuse: link to libfuse3 if fuse3 is installedXiubo Li2020-04-181-0/+11
| | | | | Fixes: https://tracker.ceph.com/issues/44891 Signed-off-by: Xiubo Li <xiubli@redhat.com>
* Revert "Merge pull request #16715 from adamemerson/wip-I-Object!"Sage Weil2019-11-221-8/+2
| | | | | | | | | This reverts commit 669453138d89e0f797a1bd37f38a2d68e6aac366, reversing changes made to 36f5fcbb97eb2b1bceb526331eb3464f460fc701. Signed-off-by: Sage Weil <sage@redhat.com> - conflicts due to code rearrangement in 14b0db908f652032c358e419ffa90f5676698d0e
* osdc: Asiofact the ObjecterAdam C. Emerson2019-11-041-1/+1
| | | | Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
* monc: Asifoact MonClientAdam C. Emerson2019-11-041-1/+7
| | | | | | Of course now everyone has to feed an io_context into the MonClient. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
* client: Use ceph_assert for asserts.Adam C. Emerson2018-08-271-3/+3
| | | | Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
* common: move ConfigValues out of md_config_tKefu Chai2018-07-101-6/+6
| | | | | | | | | | | | by moving ConfigValues out of md_config_t, we are able to point md_config_t to a new ConfigValues instance at runtime, without destroying the old one. also remove ConfigReader, because all md_config_obs_t will be updated with ConfigProxy now. as md_config_t is not able to offer the *data* anymore. Signed-off-by: Kefu Chai <kchai@redhat.com>
* common/config: support to save and re-expand special metavariablesZhi Zhang2018-04-201-0/+1
| | | | | | | | | Support to save and re-expand special metavariables according to daemon needs. Currently only special meta $pid is added, so ceph-fuse daemon can re-expand its configurations that contain $pid (e.g, admin_socket, log_file, etc) to the correct value in child process. Signed-off-by: Zhi Zhang <zhangz.david@outlook.com>
* ceph-fuse: exit with failure on failed mountPatrick Donnelly2018-04-121-1/+3
| | | | | | Fixes: https://tracker.ceph.com/issues/23665 Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
* Merge tag 'v13.0.2'Sage Weil2018-04-031-4/+9
|\ | | | | | | v13.0.2
| * global: output usage on -h, --help, or no args before contacting monsSage Weil2018-03-151-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | - when there are no arguments, print a short invitation to stderr to use -h or --help and exit with an error. - if we get -h or --help, print usage to stdout, and exit with success. - do the above *before* making any contact with the cluster. we should not fail to explain usage because the mons are down. - if there is some other error with the arguments, print an error message, but do not spam the user with usage. Try to use cerr instead of derr. Signed-off-by: Sage Weil <sage@redhat.com>
* | Merge PR #20798 into masterPatrick Donnelly2018-03-271-0/+13
|\ \ | | | | | | | | | | | | | | | | | | * refs/pull/20798/head: ceph-fuse: trim ceph-fuse -V output Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
| * | ceph-fuse: trim ceph-fuse -V outputJos Collin2018-03-131-0/+13
| |/ | | | | | | | | | | | | Trim 'ceph-fuse -V' output to print the FUSE library version and exit. Fixes: http://tracker.ceph.com/issues/23248 Signed-off-by: Jos Collin <jcollin@redhat.com>
* / ceph-fuse: Fix Segmentation fault --localize-readsJos Collin2018-03-171-3/+1
|/ | | | | Fixes: http://tracker.ceph.com/issues/23288 Signed-off-by: Jos Collin <jcollin@redhat.com>
* drop unnecessary env_to_vec callsSage Weil2018-03-061-1/+0
| | | | | | global[_pre]_init does this for us now. Signed-off-by: Sage Weil <sage@redhat.com>
* mon/MonClient: one-shot mon connection on started to fetch configSage Weil2018-03-061-5/+2
| | | | | | | | | | | | | | This is not particularly efficient, but it works: - connect to the monitor to get the monmap and config - tear it all down - proceed with normal startup (which presumably involves reconnecting to the mon all over again). This allows us to set config options that may affect the mon communication itself, like ms_type. Signed-off-by: Sage Weil <sage@redhat.com>
* common: refactor default config value handlingSage Weil2018-03-061-2/+4
| | | | | | | | - pass an optional map<string,string> instead of an arg list - remember default values in md_config_t - some nicer helpers Signed-off-by: Sage Weil <sage@redhat.com>
* common: Sign in early SIGHUP signalhuanwen ren2018-02-051-3/+3
| | | | | | | Contains the following process: ceph-mon ceph-mgr ceph-mds ceph-fuse radosgw. Signed-off-by: huanwen ren <ren.huanwen@zte.com.cn>
* client: quit on failed remount during dentry invalidate testPatrick Donnelly2017-12-051-2/+4
| | | | | | Fixes: http://tracker.ceph.com/issues/22269 Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
* client: Switch to new style config options and some cleanupShinobu Kinjo2017-11-231-24/+37
| | | | Signed-off-by: Shinobu Kinjo <shinobu@redhat.com>
* cephfs/ceph-fuse: add and modify ceph-fuse mount hinthuanwen ren2017-07-271-3/+3
| | | | | | | | | 1. "-n" is applied the client authorization feature. 2. "root_directory" misleading to mount the root directory , in fact, here mount should be "sub_directory". Refer to: http://docs.ceph.com/docs/master/cephfs/client-auth/#cephfs-client-capabilities Signed-off-by: huanwen ren <ren.huanwen@zte.com.cn>
* client: enable using external ObjecterJohn Spray2017-05-031-2/+2
| | | | | | | | | | | | To enable places that already have an objecter (such as ceph-mgr) to avoid spinning up another one inside Client. This will also be a path to re-using the librados objecter in multiple instances of libcephfs in the same process, a la nfs-ganesha. Signed-off-by: John Spray <john.spray@redhat.com>
* ceph_fuse.cc: fix 64/32bit detectionDanny Al-Gaaf2017-04-101-2/+2
| | | | | | | | Fix for: [src/ceph_fuse.cc:111]: (style) Condition 'sizeof(long)==4' is always false Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
* Merge pull request #13785 from liewegas/wip-cleanup-featuresSage Weil2017-03-081-2/+2
|\ | | | | | | | | msg: no need to pass supported features to Messenger::Policy ctor Reviewed-by: Haomai Wang <haomai@xsky.com>
| * msg/Messenger: drop useless 'supported' arg to Policy ctorSage Weil2017-03-031-2/+2
| | | | | | | | | | | | We always use CEPH_FEATURES_DEFAULT_SUPPORTED (= CEPH_FEATURES_ALL) here. Signed-off-by: Sage Weil <sage@redhat.com>
* | common: add override in header fileliuchang08122017-03-031-1/+1
|/ | | | Signed-off-by: liuchang0812 <liuchang0812@gmail.com>
* ceph_fuse: fix daemonization when pid file is non-emptyYan, Zheng2017-02-231-15/+19
| | | | | | | | | | | During daemonizing ceph-fuse, both the parent and child processes call global_init_postfork_start(). global_init_postfork_start() calls pidfile_write(). If pid file is non-empty, one pidfile_write() call fails because it can't lock the pid file. The fix is only child process calls global_init_postfork_start() Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
* Merge pull request #13443 from Liuchang0812/cleanup-commonKefu Chai2017-02-161-2/+2
|\ | | | | | | | | common: add override in common and misc Reviewed-by: Kefu Chai <kchai@redhat.com>
| * common: add override for common submodule and miscliuchang08122017-02-161-2/+2
| | | | | | | | | | | | Fixes: http://tracker.ceph.com/issues/18922 Signed-off-by: liuchang0812 <liuchang0812@gmail.com>
* | ceph-fuse: always free allocated fuse_argsKefu Chai2017-02-131-7/+7
|/ | | | Signed-off-by: Kefu Chai <kchai@redhat.com>
* fuse: remove dead code after usage() callNathan Cutler2017-01-051-1/+0
| | | | | | | usage() calls generic_client_usage(), which calls exit(-1), which never returns. Signed-off-by: Nathan Cutler <ncutler@suse.com>
* ceph_fuse: pid_file default to emptyNathan Cutler2017-01-051-2/+4
| | | | | Fixes: http://tracker.ceph.com/issues/18309 Signed-off-by: Nathan Cutler <ncutler@suse.com>
* dout: Use dout_contextAdam C. Emerson2016-12-221-4/+6
| | | | | | | As a transition for g_ceph_context removal, make all dout macros depends on a local macro. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
* ceph-fuse: rewrite the fork hackery using PreforkKefu Chai2016-12-081-51/+22
| | | | | | | | | | | | | | | | | in this change we use global_init_postfork_start() to restart the log after it is stopped by Preforker. * ceph_fuse.c: - rewrite the fork hackery using Preforker helper class - write "starting ceph client" message to cerr, as the cout was closed by global_init_postfork_start() * fuse_ll.cc: write -1 to signal the parent process that init is done. * Preforker.h: add a helper method to return the fd to which, the child process can write an int to notify its status. Signed-off-by: Kefu Chai <kchai@redhat.com>
* ceph-fuse: start up log on parent process before shutdownGreg Farnum2016-12-071-0/+2
| | | | | | | | Otherwise, we hit an assert in the Ceph context and logging teardown. Fixes: http://tracker.ceph.com/issues/18157 Signed-off-by: Greg Farnum <gfarnum@redhat.com>
* Merge pull request #11733 from tchaikov/wip-17762Kefu Chai2016-11-241-3/+3
|\ | | | | | | | | | | | | common: release g_ceph_context before returns Reviewed-by: Loic Dachary <ldachary@redhat.com> Reviewed-by: Sage Weil <sage@redhat.com> Reviewed-by: Samuel Just <sjust@redhat.com>
| * common,test: g_ceph_context->put() upon returnKefu Chai2016-11-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | prior to this change, global_init() could create a new CephContext and assign it to g_ceph_context. it's our responsibilty to release the CephContext explicitly using cct->put() before the application quits. but sometimes, we fail to do so. in this change, global_init() will return an intrusive_ptr<CephContext>, which calls `g_ceph_context->put()` in its dtor. this ensures that the CephContext is always destroyed before main() returns. so the log is flushed before _log_exp_length is destroyed. there are two cases where global_pre_init() is called directly. - ceph_conf.cc: g_ceph_context->put() will be called by an intrusive_ptr<> deleter. - rgw_main.cc: global_init() is called later on on the success code path, so it will be taken care of. Fixes: http://tracker.ceph.com/issues/17762 Signed-off-by: Kefu Chai <kchai@redhat.com>
* | Merge pull request #12031 from liewegas/wip-ceph-abortKefu Chai2016-11-231-1/+1
|\ \ | | | | | | | | | | | | | | | common: assert(0) -> ceph_abort() Reviewed-by: xie xingguo <xie.xingguo@zte.com.cn> Reviewed-by: Kefu Chai <kchai@redhat.com>
| * | assert(0) -> ceph_abort()Sage Weil2016-11-221-1/+1
| |/ | | | | | | Signed-off-by: Sage Weil <sage@redhat.com>
* / client: improve failure messages/debuggingPatrick Donnelly2016-11-181-2/+2
|/ | | | Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>