summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/nfs3-fh.c
Commit message (Collapse)AuthorAgeFilesLines
* Multiple files: make root gfid a static variableYaniv Kaul2019-10-141-3/+3
| | | | | | | | | | | | | In many places we use it, compare to it, etc. It could be a static variable, as it really doesn't change. I think it's better than initializing to 0 and then doing gfid[15] = 1 or other tricks. I think there are additional oppportunuties to make more variables static. This is an attempt at an easy one. Change-Id: I7f23a30a94056d8f043645371ab841cbd0f90d19 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* libglusterfs: Move devel headers under glusterfs directoryShyamsundarR2018-12-051-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Land part 2 of clang-format changesGluster Ant2018-09-121-103/+103
| | | | | Change-Id: Ia84cc24c8924e6d22d02ac15f611c10e26db99b4 Signed-off-by: Nigel Babu <nigelb@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>
* nfs / nfs files : porting log messages to new frameworkManikandan Selvaganesh2015-04-281-4/+4
| | | | | | | | | | | | | Porting log messages to a new framework for nfs-common.c, nfs-fops.c, nfs-fops.h, nfs-inodes.c, nfs3-fh.c, nfs3-helpers.c. Change-Id: I55cd94de62eafe6ad3754cd065d7459a81a9f285 BUG: 1194640 Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com> Reviewed-on: http://review.gluster.org/10214 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* Avoid conflict between contrib/uuid and system uuidEmmanuel Dreyfus2015-04-041-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* gNFS: Export / Netgroup authentication on Gluster NFS mountNiels de Vos2015-03-151-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Parses linux style export file/netgroups file into a structure that can be lookedup. * This parser turns each line into a structure called an "export directory". Each of these has a dictionary of hosts and netgroups which can be looked up during the mount authentication process. (See Change-Id Ic060aac and I7e6aa6bc) * A string beginning withan '@' is treated as a netgroup and a string beginning without an @ is a host. (See Change-Id Ie04800d) * This parser does not currently support all the options in the man page ('man exports'), but we can easily add them. BUG: 1143880 URL: http://www.gluster.org/community/documentation/index.php/Features/Exports_Netgroups_Authentication Change-Id: I181e8c1814d6ef3cae5b4d88353622734f0c0f0b Original-author: Shreyas Siravara <shreyas.siravara@gmail.com> CC: Richard Wareing <rwareing@fb.com> CC: Jiffin Tony Thottan <jthottan@redhat.com> Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/8758 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* gNFS: Subdir mount does not work on UDP protoSantosh Kumar Pradhan2014-10-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After enabling nfs.mount-udp, mounting a subdir on a volume over NFS fails. Because mountudpproc3_mnt_3_svc() invokes nfs3_rootfh() which internally calls mnt3_mntpath_to_export() to resolve the mount path. mnt3_mntpath_to_export() just works if the mount path requested is volume itself. It is not able to resolve, if the path is a subdir inside the volume. MOUNT over TCP uses mnt3_find_export() to resolve subdir path but UDP can't use this routine because mnt3_find_export() needs the req data (of type rpcsvc_request_t) and it's available only for TCP version of RPC. FIX: (1) Use syncop_lookup() framework to resolve the MOUNT PATH by breaking it into components and resolve component-by-component. i.e. glfs_resolve_at () API from libgfapi shared object. (2) If MOUNT PATH is subdir, then make sure subdir export is not disabled. (3) Add auth mechanism to respect nfs.rpc-auth-allow/reject and subdir auth i.e. nfs.export-dir (4) Enhanced error handling for MOUNT over UDP Change-Id: I42ee69415d064b98af4f49773026562824f684d1 BUG: 1118311 Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com> Reviewed-on: http://review.gluster.org/8346 Reviewed-by: soumya k <skoduri@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* dual license: update remaining files with correct license textKaleb S. KEITHLEY2013-10-241-13/+4
| | | | | | | | | | | | | | | Sayan Saha has previously approved changing everthing to dual license but somehow we have missed changing these files. I am explicitly not updating the copyright dates as nothing else that's copyrightable has changed in these files with the license change Change-Id: Ia965eeb7168447d69e28e939ad95ee388873b6e4 BUG: 951549 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/6128 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* NFS : Coverity Fix.meghana2013-09-191-6/+6
| | | | | | | | | | | | NFS defects reported by Coverity run are fixed. Change-Id: Ib66847e8e66fb4a06b312c80814f9eafb032eba2 BUG: 996390 Signed-off-by: meghana <mmadhusu@redhat.com> Reviewed-on: http://review.gluster.org/5660 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Varun Shastry <vshastry@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* Expand gluster's NFS FD header to 4 bytesMichael Brown2013-05-011-0/+10
| | | | | | | | | | | | | | * https://bugzilla.redhat.com/show_bug.cgi?id=950121 * Oracle's DNFS does not properly XDR encoding on NFS FDs that are not congruent to 0mod4 bytes long * This patch is a workaround to support Oracle's buggy code Change-Id: Ic621e2cd679a86aa9a06ed9ca684925e1e0ec43f BUG: 950121 Signed-off-by: Michael Brown <michael@netdirect.ca> Reviewed-on: http://review.gluster.org/4918 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* nfs: make NFS filehandles deterministicAnand Avati2012-07-041-133/+5
| | | | | | | | | | | | | The NFS3 file handles now includes just the bare minimum of (ident, exportid, gfid) and removes legacy 'variable' members which are unnecessary since the introduction of GFID backend Change-Id: Iff6e4435d170074b18d208742b48e79b130e2a4d BUG: 835336 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3616 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* nfs/mount: Support MOUNT protocol on UDP. Needed for NLM on solaris clients.Krishna Srinivas2012-05-271-0/+12
| | | | | | | | | | Change-Id: I3f5c35d06827fb267a7dae53d949c61567a945d0 BUG: 799287 Signed-off-by: Krishna Srinivas <ksriniva@redhat.com> Reviewed-on: http://review.gluster.com/3337 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Amaravathi <rajesh@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* Change Copyright current yearPranith Kumar K2011-08-101-1/+1
| | | | | | | | Change-Id: I2d10f2be44f518f496427f257988f1858e888084 BUG: 3348 Reviewed-on: http://review.gluster.com/200 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
* LICENSE: s/GNU Affero General Public/GNU General Public/Pranith Kumar K2011-08-061-3/+3
| | | | | | | | Change-Id: I3914467611e573cccee0d22df93920cf1b2eb79f BUG: 3348 Reviewed-on: http://review.gluster.com/182 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
* Logging : Use of uuid_utoa and uuid_utoa_r.Gaurav2011-02-041-9/+6
| | | | | | | | Signed-off-by: Gaurav <gaurav@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2308 (Threadsafe uuid to string conversion function) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2308
* nfs: fix warnings due to format string mismatches during invocation of gf_log.Raghavendra G2010-12-141-2/+2
| | | | | | | | Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2211 ((re)introduce warnings for format string/parameter mismatch) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2211
* nfs3: More robust root gfid checksShehjar Tikoo2010-11-031-4/+6
| | | | | | | | Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2051 (find fails with loop detected error) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2051
* Change GNU GPL to GNU AGPLPranith K2010-10-041-3/+3
| | | | | | | | Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1388 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1388
* nfs3: Set gfid[15] to 1 for rootShehjar Tikoo2010-09-151-0/+1
| | | | | | | | Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1600 (showmount works but unable to mount) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1600
* nfs,nfs3,mnt3: Transition fh resolution to gfidShehjar Tikoo2010-09-141-38/+45
| | | | | | | | Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 971 (dynamic volume management) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=971
* nfs3: Logging and comments made more accurateShehjar Tikoo2010-08-311-0/+4
| | | | | | | | Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1378 (Deep directory creation crashes gnfs) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1378
* nfs3: Support hashcounts larger than hash array sizeShehjar Tikoo2010-08-311-5/+25
| | | | | | | | Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1378 (Deep directory creation crashes gnfs) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1378
* nfs: Support directory level exportsShehjar Tikoo2010-07-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nfsx has followed traditional approach of exporting whole volumes as NFS exports. The Platform requires and some users have approached us for introducing exports of only specific directories instead of full Gluster volumes. This commit introduces this support through two nfsx options: Option 1: ========= option nfs3.<volume-name>.export-dir <subdir1-in-vol>,<subdir2-in-vol>,..<subdirN-in-vol> export-dir will allow the export of a particular dir as a single export by itself. For eg.: volume posix type storage/posix option directory /export/ end-volume volume posix-ac type features/access-control subvolumes posix end-volume volume nfs type nfs/server subvolumes posix-ac option rpc-auth.addr.allow * option nfs3.posix-ac.export-dir /homes/shehjart end-volume A comma separate list of sub-directories will set up those dirs as separated exports. At the nfs client, the mount command will be: $ mount <nfsserver>:/posix-ac/homes/shehjart /mnt Option 2: ========= option nfs3.<volume-name>.export-volumes <on|off> There can be situations where users only want the directory level exports and require that volume exports be completely disabled. The above option allows us to do this. By default, volume exports are enabled. From the earlier example, replacing <volume-name> with posix-ac, will disable mounting of the posix-ac volume as a whole. Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 989 (Support directory exports in nfsx) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=989
* nfs: Add MOUNTv3 protocol supportShehjar Tikoo2010-03-311-0/+271
Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 399 (NFS translator with Mount v3 and NFS v3 support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=399