From d929ba0c5b8671150ebe1ab9057836b0fa6dadea Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Wed, 9 Nov 2016 14:24:15 -0500 Subject: [PATCH] rgw_file: fix spurious mount entries w/Linux NFS client This change fixes the initialization of root file handles to have their correct fs instance. Previously, the root file handle had fs_inst-1. The apparent change in fsid in a subordinate directory triggers the client's behavior for new filesystem mounts, which we don't want. Fixes: http://tracker.ceph.com/issues/17850 Signed-off-by: Matt Benjamin --- src/rgw/rgw_file.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_file.h b/src/rgw/rgw_file.h index 4cec6e7d5e957..db67576514490 100644 --- a/src/rgw/rgw_file.h +++ b/src/rgw/rgw_file.h @@ -781,9 +781,12 @@ namespace rgw { cct->_conf->rgw_nfs_lru_lane_hiwat), uid(_uid), key(_user_id, _key) { + /* fixup fs_inst */ + root_fh.state.dev = ++fs_inst; + /* no bucket may be named rgw_fs_inst-(.*) */ fsid = RGWFileHandle::root_name + "rgw_fs_inst-" + - std::to_string(++(fs_inst)); + std::to_string(fs_inst); root_fh.init_rootfs(fsid /* bucket */, RGWFileHandle::root_name); -- 2.39.5