From 29151137d3da3ab8c0c65f8502d5874febfeeb14 Mon Sep 17 00:00:00 2001 From: Jiffin Tony Thottan Date: Thu, 27 Aug 2015 23:26:40 +0530 Subject: snapshot : copying nfs-ganesha export file Backport of http://review.gluster.org/#/c/12483/ While taking snapshot, the export file used by the volume should copy to snap directory. So that when restore of snapshot happens, the volume can retain all its configuration for exporting via nfs-ganesha. The export file is stored at "/etc/ganesha/export" in the following format "export..conf" The fix handles given cases in the following manner : case a: The nfs-ganesha(global) is ON during snapshot and restore. i.) Volume was exported during snapshot. When we restore snapshot, then volume should be exported back with old configuration file. ii.) Volume was unexported during snapshot. When we restore snapshot, then volume should unexported again. case b: The nfs-ganesha is ON during snapshot and OFF during restore Volume was exported during snapshot. When we restore snapshot, the conf will be copied to corresponding location and if nfs-ganesha enabled again, then volume will be exported. For the clones, export conf file will created in /etc/ganesha/export and then export it via ganesha. Upstream Reference: (cherry picked from commit 5583bac79851d24f0a552478b361049fe63c32b7) >Change-Id: Ideecda15bd4db58e991cf6c8de7bb93f3db6cd20 >BUG: 1257709 >Signed-off-by: Jiffin Tony Thottan >Reviewed-on: http://review.gluster.org/12034 >Reviewed-by: Avra Sengupta >Tested-by: Gluster Build System >Reviewed-by: Kaleb KEITHLEY Change-Id: I19725ec3d093fb32067bba4aba7f5bc3fd61b0e3 BUG: 1257710 Signed-off-by: Jiffin Tony Thottan Reviewed-on: http://review.gluster.org/12483 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Avra Sengupta Reviewed-by: Kaleb KEITHLEY --- xlators/mgmt/glusterd/src/glusterd-snapshot-utils.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'xlators/mgmt/glusterd/src/glusterd-snapshot-utils.h') diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.h b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.h index 63d39e868fb..c0e7e8e218d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.h +++ b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.h @@ -99,11 +99,18 @@ glusterd_get_geo_rep_session (char *slave_key, char *origin_volname, int32_t glusterd_restore_geo_rep_files (glusterd_volinfo_t *snap_vol); +int +glusterd_restore_nfs_ganesha_file (glusterd_volinfo_t *src_vol, + glusterd_snap_t *snap); int32_t glusterd_copy_quota_files (glusterd_volinfo_t *src_vol, glusterd_volinfo_t *dest_vol, gf_boolean_t *conf_present); +int +glusterd_copy_nfs_ganesha_file (glusterd_volinfo_t *src_vol, + glusterd_volinfo_t *dest_vol); + int glusterd_snap_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict); -- cgit