summaryrefslogtreecommitdiffstats
path: root/xlators/features/snapview-client/src/snapview-client.c
Commit message (Collapse)AuthorAgeFilesLines
* xlator/snapview: structure loggingyatip2020-02-041-224/+155
| | | | | | | | | convert gf_msg() to gf_smsg() Updates: #657 Change-Id: I2dd09a205c11d1c05abc7106e67802d2aa3bca79 Signed-off-by: yatip <ypadia@redhat.com>
* snapview: fix memory leakXie Changlong2020-01-231-3/+2
| | | | | | | | | Setting frame->local = local immediately after mem_get0. In this case, SVC_STACK_UNWIND will take of freeing the memory. Change-Id: If6433be0e14ed0f4ab4127f70a8875f81bb3e6b8 updates: bz#789278 Signed-off-by: Xie Changlong <xiechanglong@cmss.chinamobile.com>
* uss: Fix tar issue with ctime and uss enabledKotresh HR2019-06-171-9/+13
| | | | | | | | | | | | | | | | | | | Problem: If ctime and uss enabled, tar still complains with 'file changed as we read it' Cause: To clear nfs cache (gluster-nfs), the ctime was incremented in snap-view client on stat cbk. Fix: The ctime should not be incremented manually. Since gluster-nfs is planning to be deprecated, this code is being removed to fix the issue. Change-Id: Iae7f100c20fce880a50b008ba716077350281404 fixes: bz#1720290 Signed-off-by: Kotresh HR <khiremat@redhat.com>
* features/snapview-client: access priv->path inside lockRaghavendra Bhat2018-12-171-72/+354
| | | | | | | | | | To handle the race condition of a fop or a function accessing priv->path and a reconfigure changing priv->path (because entry point directory changed), the private structure's path is guarded by the lock. updates bz#1650403 Change-Id: I61c539da06d68d38eafcf2155699c7702f31323e Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
* xlator: make 'xlator_api' mandatoryAmar Tumballi2018-12-131-0/+14
| | | | | | | | | | | | | | * Remove the options to load old symbol. * keep only 'xlator_api' symbol from being exported using xlator.sym * add xlator_api to all the xlators where its missing NOTE: This covers all the xlators which has at least a test case to validate its loading. If there is a translator, which doesn't have any test, then we should probably remove that from codebase. fixes: #164 Change-Id: Ibcdc8c9844cda6b4463d907a15813745d14c1ebb Signed-off-by: Amar Tumballi <amarts@redhat.com>
* libglusterfs: Move devel headers under glusterfs directoryShyamsundarR2018-12-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | libglusterfs devel package headers are referenced in code using include semantics for a program, this while it works can be better especially when dealing with out of tree xlator builds or in general out of tree devel package usage. Towards this, the following changes are done, - moved all devel headers under a glusterfs directory - Included these headers using system header notation <> in all code outside of libglusterfs - Included these headers using own program notation "" within libglusterfs This change although big, is just moving around the headers and making it correct when including these headers from other sources. This helps us correctly include libglusterfs includes without namespace conflicts. Change-Id: Id2a98854e671a7ee5d73be44da5ba1a74252423b Updates: bz#1193929 Signed-off-by: ShyamsundarR <srangana@redhat.com>
* features/snapview-client: replace gf_log with gf_msgRaghavendra Bhat2018-10-101-167/+168
| | | | | | Change-Id: I87f01d86f50eb2fca21febb0ea3e77fbd152eb93 updates: bz#1626610 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
* Land part 2 of clang-format changesGluster Ant2018-09-121-1938/+1954
| | | | | Change-Id: Ia84cc24c8924e6d22d02ac15f611c10e26db99b4 Signed-off-by: Nigel Babu <nigelb@redhat.com>
* All: run codespell on the code and fix issues.Yaniv Kaul2018-07-221-3/+3
| | | | | | | | | | | | Please review, it's not always just the comments that were fixed. I've had to revert of course all calls to creat() that were changed to create() ... Only compile-tested! Change-Id: I7d02e82d9766e272a7fd9cc68e51901d69e5aab5 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* snapview: Coverity FixesAshish Pandey2017-11-081-1/+1
| | | | | | | | | Coverity ID: 259 Coverity ID: 163 Change-Id: I7f7753b870715e1176826fb8dfbe81119750d113 BUG: 789278 Signed-off-by: Ashish Pandey <aspandey@redhat.com>
* uss/svc: Send the first lookup to the normal graphMohammed Rafi KC2017-08-141-5/+8
| | | | | | | | | | | | | | | When parent inode is not looked up before, the inode type won't be set. In this scenario we should send the lookup to the normal graph first. Change-Id: I5d3e53f5c1c33a17be32204f3114749d9b1e6db8 BUG: 1480591 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: https://review.gluster.org/18028 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: soumya k <skoduri@redhat.com>
* uss/svc: fix double free on xdata dictionaryMohammed Rafi KC2017-07-091-7/+18
| | | | | | | | | | | | | we were taking unref on wrong dictionary which results in wrong memory access. Change-Id: Ic25a6c209ecd72c9056dfcb79fabcfc650dd3c1e BUG: 1467513 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: https://review.gluster.org/17691 CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
* svc: send revalidate lookup on special dirMohammed Rafi KC2017-07-091-0/+77
| | | | | | | | | | | | | | | | | | | | | | | .snaps directory is a virtual direcotory, that doesn't exist on the backend. Even though it is a special dentry, it doesn't have a dedicated inode. So the inode number is always random. Which means it will get different inode number when reboot happens on snapd process. Now with windows client the show-direcotry feature requires a lookup on the .snpas direcoty post readdirp on root. If the snapd restarted after a lookup, then subsequent lookup will fail, because linked inode will be stale. This patch will do a revalidate lookup with a new inode. Change-Id: If97c07ecb307cefe7c86be8ebd05e28cbf678d1f BUG: 1467513 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: https://review.gluster.org/17690 CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org>
* features/uss: Remove redundant dict_unrefAnoop C S2017-01-061-1/+0
| | | | | | | | | | | | | In case dict_set_dynstr_with_alloc fails, dict_unref is done when exection jumps to label 'out'. Change-Id: I083386b7f85207348ba0bc353b5d1036ab821a15 Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-on: http://review.gluster.org/16321 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
* snapshot/uss: client-side log is filled with "invalid-argument" errorRajesh Joseph2016-05-311-1/+7
| | | | | | | | | | | | | xdata is used without checking if it is NULL or not. Change-Id: Ib6ddaab28ec3b430b8d646aada0456d3cc9978cb BUG: 1339149 Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-on: http://review.gluster.org/14511 Smoke: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
* snapshot/uss: client log is filled with "invalid argument: inode" errorRajesh Joseph2016-05-251-2/+6
| | | | | | | | | | | | | | svc_inode_ctx_get is called even if inode is NULL. We should not call this function if inode is NULL Change-Id: I5c3f17633ca88e5b6f40d4acf14a09e14b7ef62b BUG: 1339149 Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-on: http://review.gluster.org/14525 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
* snapshot: svc_stat collides with define from /usr/include/rpc/svc.hNiels de Vos2016-04-271-179/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compiling fails with this error: snapview-client.c:559:24: error: macro "svc_stat" passed 4 arguments, but takes just 1 dict_t *xdata) ^ snapview-client.c:560:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token { ^ snapview-client.c:2412:26: error: ‘svc_stat’ undeclared here (not in a function) .stat = svc_stat, ^ svc_* is the common prefix for (SUN)RPC functions provided by system headers. svc_stat() seems to be an existing function name. This happens because change-id I98fc8cf7e4b631082c7b203b5a0a77111bec1fb9 causes <rpc/rpc.h> included through "glusterfs.h". Prepending gf_ for all svc_* functions works around the symbol collision. Change-Id: Idc86b719c48675a5154c54d844c1899d14d46e2a BUG: 1328502 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/14035 Smoke: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
* gluster/uss: change ctime attr of a dir when USS enabledvmallika2016-03-101-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | Consider a testcase: mount -t nfs host1:/vol1 /mnt ls /mnt ls /mnt/.snaps (As expected this fails) gluster volume set vol1 features.uss enable Now `ls /mnt/.snaps` should work, but fails with No such file or directory. This is because NFS client and Kernel VFS caches the list of files in a directory. This cache is updated if there are any changes in the directory attributes. This patch solves the problem by changing ctime attribute when USS is enabled Change-Id: I48b284100d0589f1c0285782a1302080c15d4e1f BUG: 1163416 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/9106 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
* USS: pre-existing .snaps should not be listed with 'ls -a' with USS enabledvmallika2016-02-151-13/+66
| | | | | | | | | | | | | | If there is a .snaps directory pre-exists and when USS is enabled, it should not be listed with 'ls -a' Change-Id: I1c43e2decc0bbbd3213b190b675e3a32d04b22d3 BUG: 1303828 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/13330 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
* snapview-client: remove check for parent inode typeMohammed Rafi KC2016-01-121-26/+0
| | | | | | | | | | | | | | | | In lookup call back path, we are checking for parent inode type to make sure parent inode was set properly, so that next op on the inode can be successfuly completed. More info can be found at bugid 1297311 Change-Id: Ifb1b17f472f855f9b12088c3dd8328389d895e77 BUG: 1297311 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/13227 Reviewed-by: Avra Sengupta <asengupt@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
* features/snap : cleanup the root loc in statfsAshish Pandey2015-10-201-1/+1
| | | | | | | | | | | | | | | | Problem : In svc_statfs function, wipe_loc is getting called on loc passed by nfs. This loc is being used by svc_stat which throws erro if loc->inode is NULL. Solution : wipe_loc should be called on local root_loc. Change-Id: I9cc5ee3b1bd9f352f2362a6d997b7b09051c0f68 BUG: 1260848 Signed-off-by: Ashish Pandey <aspandey@redhat.com> Reviewed-on: http://review.gluster.org/12123 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* snapshot: Make fops static for correct resolution of symbolsSoumya Koduri2015-08-241-36/+38
| | | | | | | | | | | | | | | Few of the snapshot fops (like 'svc_lookup') may not get resolved while using dynamic loading as there could be other libraries(like libntirpc) with same routine names. Making them static to resolve the same. Change-Id: I6577bf3705864f5583425c94427b4e1025a59bcd BUG: 1248669 Signed-off-by: Soumya Koduri <skoduri@redhat.com> Reviewed-on: http://review.gluster.org/11805 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* snapview-client: Allocate memory using GF_CALLOCMohammed Rafi KC2015-07-091-1/+1
| | | | | | | | | | | | | | loc->path memory should allocate through GF_CALLOC/GF_MALLOC, since it uses GF_FREE from loc_wipe. Change-Id: If3030175dfb07b0e0b6c0a30234857f8a0780035 BUG: 1240184 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/11543 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* uss: Take ref on root inodeMohammed Rafi KC2015-06-041-2/+3
| | | | | | | | | | | | | | If we recieve a statfs call on snap directory, we will redirect the call into the root, by creating a new root loc. So it is better to take a ref on the root inode. (http://review.gluster.org/#/c/10358/5/xlators/features/ snapview-client/src/snapview-client.c) Change-Id: I5649addac442d391b2550346b115dec58fed5b86 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/10750 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
* build: do not #include "config.h" in each fileNiels de Vos2015-05-291-5/+0
| | | | | | | | | | | | | | | | | | Instead of including config.h in each file, and have the additional config.h included from the compiler commandline (-include option). When a .c file tests for a certain #define, and config.h was not included, incorrect assumtions were made. With this change, it can not happen again. BUG: 1222319 Change-Id: I4f9097b8740b81ecfe8b218d52ca50361f74cb64 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/10808 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* uss : implement statfs fop for snapdMohammed Rafi KC2015-05-101-0/+59
| | | | | | | | | | | | | | | snapview-client and snapview-server doesnot have statfs fop implemented Change-Id: I2cdd4c5784414b0549a01af9a28dbc723b7cdc67 BUG: 1176837 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/10358 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Tested-by: NetBSD Build System Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* snapview: Fixing the coverity issuesNandaja Varma2015-04-041-1/+2
| | | | | | | | | | | | | | | Coverity CIDs: 1228601 1220056 1238185 1257624 Change-Id: Idb4cc3b44bc3ccb8b497ce355e1e3bacfb176db9 BUG: 789278 Signed-off-by: Nandaja Varma <nandaja.varma@gmail.com> Reviewed-on: http://review.gluster.org/9615 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Avoid conflict between contrib/uuid and system uuidEmmanuel Dreyfus2015-04-041-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | glusterfs relies on Linux uuid implementation, which API is incompatible with most other systems's uuid. As a result, libglusterfs has to embed contrib/uuid, which is the Linux implementation, on non Linux systems. This implementation is incompatible with systtem's built in, but the symbols have the same names. Usually this is not a problem because when we link with -lglusterfs, libc's symbols are trumped. However there is a problem when a program not linked with -lglusterfs will dlopen() glusterfs component. In such a case, libc's uuid implementation is already loaded in the calling program, and it will be used instead of libglusterfs's implementation, causing crashes. A possible workaround is to use pre-load libglusterfs in the calling program (using LD_PRELOAD on NetBSD for instance), but such a mechanism is not portable, nor is it flexible. A much better approach is to rename libglusterfs's uuid_* functions to gf_uuid_* to avoid any possible conflict. This is what this change attempts. BUG: 1206587 Change-Id: I9ccd3e13afed1c7fc18508e92c7beb0f5d49f31a Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/10017 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* features/snapview-client: Don't free un-allocated memoryPranith Kumar K2015-03-271-2/+0
| | | | | | | | | | Change-Id: I8636ced27448dde4f2c11370fe2026067d4a7e74 BUG: 1203637 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/10004 Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/uss: Perform NULL check on @name in svc_getxattrKrutika Dhananjay2015-01-021-1/+4
| | | | | | | | | | | | | | | | | | | LISTXATTR fop is internally converted into a GETXATTR with the "name" parameter set to NULL. In svc_getxattr(), a listxattr was causing a crash because of a NULL pointer dereference on @name. FIX: Add the necessary NULL check. Change-Id: I70024d40dc0695648c6d41b423c2665d030e1232 BUG: 1178079 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/9378 Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Sachin Pandit <spandit@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/snapview-client: handle fsync fopRaghavendra Bhat2014-12-121-0/+45
| | | | | | | | | | Change-Id: Idaf46bd7497266af837789b09a0c62698f56ee4e BUG: 1172262 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/9258 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Sachin Pandit <spandit@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/snapview-client: handle readdir requests differently for sambaRaghavendra Bhat2014-12-091-8/+548
| | | | | | | | | | | * For samba export, the entry point is also added to the readdir response. Change-Id: I825c017e0f16db1f1890bb56e086f36e6558a1c2 BUG: 1168875 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/9218 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* uss: CIFS gives error while accessing .snaps directoryRajesh Joseph2014-12-031-7/+48
| | | | | | | | | | | | | | | | | | | | | CIFS sends getxattr call while accessing .snaps directory. snapview server should return ENODATA if getxattr is called on .snaps folder. Also flush on .snaps folder should be handled. Windows client sends and getxattr call on the parent folder of .snaps with a special key to get the real filename of a file. This is used by samba to do case insensitive check of files. Fixed few FreeBSD compilation error. bug: 1168875 Change-Id: I74d5cb4419568c8ed8709ba6d1ddff0e41392204 Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-on: http://review.gluster.org/9211 Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* gluster/uss: Handle notify in snapview-clientvmallika2014-11-281-0/+25
| | | | | | | | | | | | | | | As there are two subvolumes in snapview-client, there is a possibility that the regular subvolume is still down and snapd subvolume come up first. So if we don't handle this situation CHILD_UP event will be propagated upwards to fuse when regular subvolume is still down. This can cause data unavailable for the application Change-Id: I9e5166ed22c2cf637c15db0457c2b57ca044078e BUG: 1168643 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/9205 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* gluster/uss: Handle ESTALE in snapview client when NFS server restartedvmallika2014-11-251-13/+22
| | | | | | | | | | | | | | | When NFS server is restarted inode-context is lost. Nameless lookup will be sent to regular volume. If the gfid is from virtual graph, lookup will fail with ESTALE. We need to send a lookup to snapview server Change-Id: I22920614f0d14cb90b53653fce95b6b70023eba6 BUG: 1166197 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/9153 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Sachin Pandit <spandit@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* gluster/uss: Don't send failure when accessing snap with namevmallika2014-11-171-14/+2
| | | | | | | | | | | | | | | | | | same as entry-point name In a scenario, if the snap name is same as the snap-directory than cd to snaps/snaps fails. Send a lookup to snap-view server instead of failing Change-Id: Ie7b811815ff30961500592bbc8cdb514a9d76ef5 BUG: 1164613 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/9135 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* uss/gluster: creating file/directories inside .snaps should fail withvmallika2014-11-131-17/+17
| | | | | | | | | | | | | | | EROFS When an attempt is made to create file/directories inside .snaps, it fails with wrong error message as "Stale file handle". It should fail with "Read-only file system" Change-Id: I3a812a0afc4762cbb71ab180b9394c866e576a66 BUG: 1159840 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/9039 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* USS : Decide the log entry based on the type of graph.Sachin Pandit2014-09-291-5/+12
| | | | | | | | | | | | | | | | | | Problem : When a lookup is issued, and if the entry is not found then snapview-client will log failure stating that "Lookup on normal graph failed with error Stale file handle" irrespective of type of graph it received call back from. Solution : Introduced a check to find out the graph from which the snapview-client received call-back. Change-Id: Iadd5b525c394be3675d40231711058e1cf1396cd BUG: 1146479 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/8851 Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* snapview-server: register a callback with glusterd to get notificationsRaghavendra Bhat2014-09-081-7/+11
| | | | | | | | | | | | | | | * As of now snapview-server is polling (sending rpc requests to glusterd) to get the latest list of snapshots at some regular time intervals (non configurable). Instead of that register a callback with glusterd so that glusterd sends notifications to snapd whenever a snapshot is created/deleted and snapview-server can configure itself. Change-Id: I17a274fd2ab487d030678f0077feb2b0f35e5896 BUG: 1119628 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/8150 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* make snapview-server more compatible with NFS serverRaghavendra Bhat2014-07-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * There was no handle based API for listxattr. With this change, glfs_h_getxattrs also handles the listxattr functionality by checking whether the name is NULL or not (like posix). But all the gfapi functions for listxattr (glfs_h_getxattrs AND glfs_listxattr AND glfs_flistxattr) returns the names of the xattrs in a buffer provided by the caller. But snapview-server has to return the list of xattrs in a dict itself (similar to posix xlator). But the buffer just contains the names of the xattrs. So for each xattr, a zero byte value is set (i.e. "") into the dict and sent back. Translators which do xattr caching (as of now md-cache which caches selinux and acl related xattrs) should not cache those xattrs whose value is a zero byte data (""). So made changes in md-cache to ignore zero byte values. * NFS server was not linking the inodes to inode table in readdirp. This was leading to applications getting errors. The below set of operations would lead to applications getting error 1) ls -l in one of the snaopshots (snapview-server would generate gfids for each entry on the fly and link the inodes associated with those entries) 2) NFS server upon getting readdirp reply would not link the inodes of the entries. But it used to generate filehandles for each entry and associate the gfid of that entry with the filehandle and send it as part of the reply to nfs client. 3) NFS client would send the filehandle of one of those entries when some activity is done on it. 4) NFS server would not be able to find the inode for the gfid present in the filehandle (as the inode was not linked) and would go for hard resolution by sending a lookup on the gfid by creating a new inode. 5) snapview-client will not able to identify whether the inode is a real inode existing in the main volume or a virtual inode existing in the snapshots as there would not be any inode context. 6) Since the gfid upon which lookup is sent is a virtual gfid which is not present in the disk, lookup would fail and the application would get an error. To handle above situation, now nfs server also does inode linking in readdirp. Change-Id: Ibb191408347b6b5f21cff72319ccee619ea77bcd BUG: 1115949 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/8230 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/snapview-client: put local back to mempool after unwindRaghavendra Bhat2014-06-231-1/+3
| | | | | | | | | Change-Id: I3a709a835b21edf757ee5a1cd04cd9d1c59201dc BUG: 1111552 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/8128 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Get snapshot info dynamically via new rpc and infra for snapview-server to ↵Anand Subramanian2014-06-151-0/+4
| | | | | | | | | | | refresh snaplist BUG: 1105439 Change-Id: I4bb312a53d88f6f4955e69a3ef2b4955ec17f26d Signed-off-by: Anand Subramanian <anands@redhat.com> Reviewed-on: http://review.gluster.org/8001 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* user servicable snapshotsRaghavendra Bhat2014-05-291-0/+1687
Change-Id: Idbf27dbe088e646a8ab81cedc5818413795895ea Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Signed-off-by: Anand Subramanian <anands@redhat.com> Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/7700 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>