summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/nfs3-helpers.c
Commit message (Collapse)AuthorAgeFilesLines
* libglusterfs: add library wrapper for time()Dmitry Antipov2020-08-171-2/+2
| | | | | | | | | Add thin convenient library wrapper gf_time(), adjust related users and comments as well. Change-Id: If8969af2f45ee69c30c3406bce5baa8305fb7f80 Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Updates: #1002
* libglusterfs: Move devel headers under glusterfs directoryShyamsundarR2018-12-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* nfs : set ctx for every inode looked up nfs3_fh_resolve_inode_lookup_cbk()Jiffin Tony Thottan2018-12-031-0/+6
| | | | | | | | | | | | The inode ctx for nfs xlator is set with help nfs_fix_generation. But currently gnfs is crashing because inode_ctx is becoming null nfs3_resolve_inode_hard() is used to perform a lookup on entire path and looks like function is missing to set the ctx for inode. This patch will set ctx for the inode which it looked on. Change-Id: I464fa7f78df1bae990ebe97de8ccf6d5fb74fc9f fixes: bz#1651439 Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
* Land part 2 of clang-format changesGluster Ant2018-09-121-2581/+2474
| | | | | Change-Id: Ia84cc24c8924e6d22d02ac15f611c10e26db99b4 Signed-off-by: Nigel Babu <nigelb@redhat.com>
* Multiple files: calloc -> mallocYaniv Kaul2018-09-041-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | xlators/storage/posix/src/posix-inode-fd-ops.c: xlators/storage/posix/src/posix-helpers.c: xlators/storage/bd/src/bd.c: xlators/protocol/client/src/client-lk.c: xlators/performance/quick-read/src/quick-read.c: xlators/performance/io-cache/src/page.c xlators/nfs/server/src/nfs3-helpers.c xlators/nfs/server/src/nfs-fops.c xlators/nfs/server/src/mount3udp_svc.c xlators/nfs/server/src/mount3.c xlators/mount/fuse/src/fuse-helpers.c xlators/mount/fuse/src/fuse-bridge.c xlators/mgmt/glusterd/src/glusterd-utils.c xlators/mgmt/glusterd/src/glusterd-syncop.h xlators/mgmt/glusterd/src/glusterd-snapshot.c xlators/mgmt/glusterd/src/glusterd-rpc-ops.c xlators/mgmt/glusterd/src/glusterd-replace-brick.c xlators/mgmt/glusterd/src/glusterd-op-sm.c xlators/mgmt/glusterd/src/glusterd-mgmt.c xlators/meta/src/subvolumes-dir.c xlators/meta/src/graph-dir.c xlators/features/trash/src/trash.c xlators/features/shard/src/shard.h xlators/features/shard/src/shard.c xlators/features/marker/src/marker-quota.c xlators/features/locks/src/common.c xlators/features/leases/src/leases-internal.c xlators/features/gfid-access/src/gfid-access.c xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.c xlators/features/bit-rot/src/bitd/bit-rot.c xlators/features/bit-rot/src/bitd/bit-rot-scrub.c bxlators/encryption/crypt/src/metadata.c xlators/encryption/crypt/src/crypt.c xlators/performance/md-cache/src/md-cache.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible It doesn't make sense to calloc (allocate and clear) memory when the code right away fills that memory with data. It may be optimized by the compiler, or have a microscopic performance improvement. In some cases, also changed allocation size to be sizeof some struct or type instead of a pointer - easier to read. In some cases, removed redundant strlen() calls by saving the result into a variable. 1. Only done for the straightforward cases. There's room for improvement. 2. Please review carefully, especially for string allocation, with the terminating NULL string. Only compile-tested! .. and allocate memory as much as needed. xlators/nfs/server/src/mount3.c : Don't blindly allocate PATH_MAX, but strlen() the string and allocate appropriately. Also, align error messges. updates: bz#1193929 Original-Author: Yaniv Kaul <ykaul@redhat.com> Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: Ibda6f33dd180b7f7694f20a12af1e9576fe197f5
* nfs: revalidate lookup converted to fresh lookupMohammed Rafi KC2016-11-101-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | when an inode ctx is missing for a linked inode the revalidate lookups are converted to fresh. This could result in sending ESTALE when the gfid are recreated We are not able to reproduce the issue with normal setup, most part of RCA was done with code reading. Possible scenario in which this bug can reproduce, Delete a file and recreate a new file with same name, at the same time from another client process try to list/or access the file. In this case the second client may throw an ESTALE error for such files Thanks to Soumya and Pranith for doing the complete RCA Change-Id: I73992a65844b09a169cefaaedc0dcfb129d66ea1 BUG: 1379720 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/15580 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: soumya k <skoduri@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* nfs: Reset cs->resolvedhard while resolving an entrySoumya Koduri2016-07-171-0/+1
| | | | | | | | | | | | | | | | | | If an entry is not found in the inode table, nfs xlator should be resolving it by sending an explicit lookup to the brick process. But currently its broken in case of NFS3_LOOKUP fop where in the server bails out early resulting in sending pargfid attributes to the client. To fix the same reset 'cs->resolvedhard' so that an explicit lookup is done for the entry in the resume_fn "nfs3_lookup_resume()". Change-Id: I999f8bca7ad008526c174d13f69886dc809d9552 Signed-off-by: Soumya Koduri <skoduri@redhat.com> BUG: 1356068 Reviewed-on: http://review.gluster.org/14911 CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* cluster/afr: Don't let NFS cache stat after writesPranith Kumar K2016-05-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Problem: Afr does post-ops after write but the stat buffer it unwinds is at the time of write, so if nfs client caches this, it will see different ctime when it does stat on it after post-op is done. From NFS client's perspective it thinks the file is changed. Tar which depends on this to be correct keeps giving 'file changed as we read it' warning. If Afr instead has to choose to unwind after post-op, eager-lock, delayed-post-op will have to be disabled which will lead to bad performance for all write usecases. Fix: Don't let client cache stat after write. Change-Id: Ic6062acc6e5cdd97a9c83c56bd529ec83cee8a23 BUG: 1302948 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Signed-off-by: Anuradha Talur <atalur@redhat.com> Reviewed-on: http://review.gluster.org/13785 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: Niels de Vos <ndevos@redhat.com>
* NFS: new option nfs.rdirplus addedSakshi Bansal2016-04-071-0/+1
| | | | | | | | | | | | | | When this option is 'disabled', NFS falls back to standard readdir instead of readdirp Change-Id: Icaaf4da6533bee56160d4a81e42bb60f7d341945 BUG: 1302948 Signed-off-by: Sakshi Bansal <sabansal@redhat.com> Reviewed-on: http://review.gluster.org/13782 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: Niels de Vos <ndevos@redhat.com>
* nfs: send lookup if inode_ctx is not setMohammed Rafi KC2016-01-131-2/+7
| | | | | | | | | | | | | | | | | During resolving of an entry or inode, if inode ctx was not set, we will send a lookup. This patch also make sure that inode_ctx will be created after every inode_link. Change-Id: I137a7e2510635ff4ea6d007b671961341f89c949 BUG: 1297311 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/13224 Reviewed-by: soumya k <skoduri@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Dan Lambright <dlambrig@redhat.com>
* nfs : Inform client to perform extra GETATTR call for 'T' filesJiffin Tony Thottan2015-12-161-1/+15
| | | | | | | | | | | | | | | | | | | Due to the changes from http://review.gluster.org/#/c/12722/, for tier volume the readirp will be send only to cold subvol, therefore the resulting list may contain 'T' files. For those files, by performing additional getattr call will populate the attributes correctly. This check should be based on inode value passed from the readdirp(both T files and directory have NULL value) and skip directory in the same. Change-Id: Ieb6724b05301cdbf0a0ef15ad9db51014faa0457 BUG: 1291212 Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com> Reviewed-on: http://review.gluster.org/12960 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: soumya k <skoduri@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* nfs : logging improvementsManikandan Selvaganesh2015-09-111-46/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NFS log-warning messages logged twice in cbk function. Though, the logging messages are not exactly duplicate, instead of logging twice, they can be merged to one log message and the other log message is removed in cbk functions. Example: (1) W [nfs3.c:2075:nfs3svc_write_cbk] 0-nfs: 16f4dce6: /f.195 => -1 (Disk quota exceeded) (2) W [nfs3-helpers.c:3443:nfs3_log_write_res] 0-nfs-nfsv3: XID: 16f4dce6, WRITE: NFS: 69(Resource (quota) hard limit exceeded), POSIX: 122 (Disk quota exceeded), count: 0, UNSTABLE, wverf: 1381508849 Here, the second message is more elaborative, and is similar to (1). Since file name is not present in (2), it is added to (2) and then removing all mesages of type (1). Change-Id: I6028ab17b23948493a065dfad92fe4984548511f BUG: 1254146 Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com> Reviewed-on: http://review.gluster.org/11936 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: jiffin tony Thottan <jthottan@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* all: reduce "inline" usageJeff Darcy2015-09-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | There are three kinds of inline functions: plain inline, extern inline, and static inline. All three have been removed from .c files, except those in "contrib" which aren't our problem. Inlines in .h files, which are overwhelmingly "static inline" already, have generally been left alone. Over time we should be able to "lower" these into .c files, but that has to be done in a case-by-case fashion requiring more manual effort. This part was easy to do automatically without (as far as I can tell) any ill effect. In the process, several pieces of dead code were flagged by the compiler, and were removed. Change-Id: I56a5e614735c9e0a6ee420dab949eac22e25c155 BUG: 1245331 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/11769 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Venky Shankar <vshankar@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-101/+160
| | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* nfs: nfs3_stat_to_fattr3() improvementNiels de Vos2015-02-281-48/+44
| | | | | | | | | | | | | | | | During a review of backorti http://review.gluster.org/9170, Kaleb points out: ick, return-by-value. About 50% slower than passing a pointer to the target struct. Change-Id: I4464e6a4e50d82d446a834892d0308332b7c32d0 BUG: 1197142 Reported-by: Kaleb KEITHLEY <kkeithle@redhat.com> Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9772 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* gNFS: Subdir mount does not work on UDP protoSantosh Kumar Pradhan2014-10-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* build: MacOSX Porting fixesHarshavardhana2014-04-241-2/+2
| | | | | | | | | | | | | | | | | | | | | git@forge.gluster.org:~schafdog/glusterfs-core/osx-glusterfs Working functionality on MacOSX - GlusterD (management daemon) - GlusterCLI (management cli) - GlusterFS FUSE (using OSXFUSE) - GlusterNFS (without NLM - issues with rpc.statd) Change-Id: I20193d3f8904388e47344e523b3787dbeab044ac BUG: 1089172 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Signed-off-by: Dennis Schafroth <dennis@schafroth.com> Tested-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Dennis Schafroth <dennis@schafroth.com> Reviewed-on: http://review.gluster.org/7503 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* gNFS: RFE for NFS connection behaviorSantosh Kumar Pradhan2013-11-141-0/+14
| | | | | | | | | | | | | | | Implement reconfigure() for NFS xlator so that volume set/reset wont restart the NFS server process. But few options can not be reconfigured dynamically e.g. nfs.mem-factor, nfs.port etc which needs NFS to be restarted. Change-Id: Ic586fd55b7933c0a3175708d8c41ed0475d74a1c BUG: 1027409 Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com> Reviewed-on: http://review.gluster.org/6236 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* gNFS: NFS segfaults with nfstest_posix toolSantosh Kumar Pradhan2013-11-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | Problem: nfs3_stat_to_fattr3() missed a NULL check. FIX: (1) Added a NULL check. (2) In all fop cbk path, if the op_ret is -1 and op_errno is 0, then handle it as a special case. Set the NFS3 status as NFS3ERR_SERVERFAULT instead of NFS3_OK. (3) The other component of FIX would be in DHT module and is on the way. Change-Id: I6f03c9a02d794f8b807574f2755094dab1b90c92 BUG: 1010241 Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com> Reviewed-on: http://review.gluster.org/6026 Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.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>
* gNFS: NFS daemon is limiting IOs to 64KBSantosh Kumar Pradhan2013-09-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Problem: Gluster NFS server is hard-coding the max rsize/wsize to 64KB which is very less for NFS running over 10GE NIC. The existing options nfs.read-size, nfs.write-size are not working as expected. FIX: Make the options nfs.read-size (for rsize) and nfs.write-size (for wsize) work to tune the NFS I/O size. Value range would be 4KB(Min)-64KB(Default)-1MB(max). NB: Credit to "Richard Wareing" for catching it. Change-Id: I2754ecb0975692304308be8bcf496c713355f1c8 BUG: 1009223 Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com> Reviewed-on: http://review.gluster.org/5964 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* NFS : Coverity Fix.meghana2013-09-191-64/+65
| | | | | | | | | | | | 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>
* nfs: ACCESS - reply only what was asked forAnand Avati2013-03-221-2/+4
| | | | | | | | | | | | | Set only those bits which were requested by the client. Some clients, like AIX, do not like the fact that we are returning the EXEC bit set in the ACCESS reply even though it only asked for LOOKUP bit. Change-Id: I3c2fd5dce030ea5ddae0511497cafa078c4d76d6 BUG: 924481 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/4707 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
* nfs: after resolving the entry use the linked inode instead of old inodeRaghavendra Bhat2012-11-191-1/+2
| | | | | | | | | Change-Id: I56add0c3c852d096ec70a0e35610f46c2d12980a BUG: 877885 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/4205 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* core: reduce the usage of global variablesAmar Tumballi2012-08-031-17/+17
| | | | | | | | | | | | | | | | | | | | | | | * move all the 'logging' related global variables into ctx * make gf_fop_list a 'const' global array, hence no init(), no edits. * make sure ctx is allocated without any dependancy on memory-accounting infrastructure, so it can be the first one to get allocated * globals_init() should happen with ctx as argument not yet fixed below in this patchset: * anything with 'THIS' related globals * anything related to compat_errno related globals as its one time init'd and not changed later on. * statedump related globals Change-Id: Iab8fc30d4bfdbded6741d66ff1ed670fdc7b7ad2 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 764890 Reviewed-on: http://review.gluster.com/3767 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* remove code that was part of hard resolution which is not needed anymore.v3.3.0qa28krishna2012-03-141-236/+0
| | | | | | | | | | Change-Id: I9321745a40765eff048a656a7885f12847a0a318 BUG: 781318 Signed-off-by: krishna <ksriniva@redhat.com> Reviewed-on: http://review.gluster.com/2830 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* nfs: no need to recalculate the 'ino' from gfidAmar Tumballi2012-03-141-10/+7
| | | | | | | | | | | it is guaranteed to be sent properly from posix layer itself now Change-Id: Ifbbf558f3bcfa609bf107a75c692003ca261ac0a Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 800831 Reviewed-on: http://review.gluster.com/2923 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* nfs/server: allow deletion of files by defaultRajesh Amaravathi2012-03-101-2/+2
| | | | | | | | | | | | | | | this is needed for Micrsoft Windows-based Nfs clients which do not ignore ACCESS3_DELETE permission not being granted, while linux/unix systems ignore the same. behaviour on linux/unix systems remains unchanged Change-Id: I67f5f66a7486b93163aebedec5fbaa303173964e BUG: 790781 Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com> Reviewed-on: http://review.gluster.com/2875 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishna Srinivas <krishna@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* support for nano second resolution for mtime,ctime,atime attributes.krishna2012-02-091-19/+8
| | | | | | | | | Change-Id: Id5078f270d0fec280b53d4aa7b16bbaf42a2df05 BUG: 784095 Signed-off-by: krishna <ksriniva@redhat.com> Reviewed-on: http://review.gluster.com/2730 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* nfs: changes for using nameless lookup and anonymous FDsAnand Avati2012-01-201-718/+1676
| | | | | | | | | | | | | | - Use gfid to create filehandle instead of encoding path components - Utilize nameless lookups of GFID for deep resolution instead of crawling the namespace with component hints - Use anonymous FDs for file based operations - Do away with fdcaching code for files and dirs Change-Id: Ic48fb23370b25d183f7e1fc1cc5dffa9d5bab3fb BUG: 781318 Reviewed-on: http://review.gluster.com/2645 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
* glusterfs: An effort to fix all the spell mistakes and typoHarshavardhana2011-11-161-2/+2
| | | | | | | | | | | | | | | in the entire glusterfs codebase. This patch fixes many of spell mistakes and typo in the entire glusterfs codebase and all supported modules. Change-Id: I83238a41aa08118df3cf4d1d605505dd3cda35a1 BUG: 3809 Signed-off-by: Harshavardhana <fharshav@redhat.com> Reviewed-on: http://review.gluster.com/731 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* NFS: logging enhancement.Gaurav2011-11-161-7/+14
| | | | | | | | | Change-Id: Ie1731a6b2b63e07bc49a84c2f9dd87c5b50a9f53 BUG: 3527 Reviewed-on: http://review.gluster.com/573 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* NFS : Posix compliance fixes.Gaurav2011-09-221-4/+6
| | | | | | | | | Change-Id: I4f1d8883a3eedee20557e306815674a6dc062bfe BUG: 1337 Reviewed-on: http://review.gluster.com/487 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* nfs3: Resolve entry vs. hash conflict at same dir depthShehjar Tikoo2011-09-071-15/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Intro Note ========== The current code in hard fh resolution takes the first-match approach, i.e. which ever dirent either matches the hash or matches the gfid first is the one chosen as the result for the next step of fh resolution. In the latter case, i.e., dirent matches the gfid, we the next step is to conclude the fh resolution by returning the entry whose gfid matched. In the former, i.e., the hash matches the dirent, we choose the hash-matching dirent as the next directory to descend into, for searching the file to be operated upon. Problem ======= When performing hard fh resolution, there can be a situation where: o the hash of the primary entry,i.e. the entry we're looking for and the hash of another sibling directory, match. Note the use of "sibling", meaning both the primary entry and the hash matching one are in the same directory, i.e., their filehandle.hashcount will be same. o the sibling directory is encountered first during the dir search. Because of the current code described in "Intro", we'll end up descending into the sibling directory even though the correct behaviour is to ignore this and wait till we encounter the primary entry in the same parent directory. Once we end up descending into this sibling directory, the directory depth validation check fails. The check fails because it notices that the resolution is attempting to open a directory that is deeper in the fs tree than the file we're looking for. When this check fails, we return an ESTALE. So basically, a false-positive results in an estale to Specsfs. This is not a theoretical situation. Me and Avati saw this on specsfs test where sfs created terabytes-sized file system for its tests. The number of files was so huge in a single directory that the hashes of two entries ended up colliding. Change-Id: I4a6df11d326a67a507b1cd716c2c8e00b5a858a4 BUG: 3510 Reviewed-on: http://review.gluster.com/357 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shehjar Tikoo <shehjart@gluster.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>
* RPC unify code changekrishna2011-07-291-2/+3
| | | | | | | | | Change-Id: Ibe18a2a63fd023ac57652c4dfc8ac8a69d983b83 BUG: 3112 Signed-off-by: krishna <krishna@gluster.com> Reviewed-on: http://review.gluster.com/116 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com>
* NFS: Implement nfs_forget callshishir2011-07-281-5/+8
| | | | | | | | | | | | Make sure the inode_ctx is deleted nfs_release is not needed, as __nfs3_fdcache_remove_entry cleans up the ctx Change-Id: I690efa1eb1d4cd39cee258bb29692cc58ab9c380 BUG: 3250 Reviewed-on: http://review.gluster.com/103 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shehjar Tikoo <shehjart@gluster.com>
* NFS access control list: Decode the NFS requests into mode formatshishir gowda2011-07-131-0/+15
| | | | | | | | | | | | Signed-off-by: shishir gowda <shishirng@gluster.com> Signed-off-by: Vijay Bellur <vijay@gluster.com> BUG: 3057 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3057 Signed-off-by: Anand Avati <avati@gluster.com> BUG: 3057 (acl permissions don't work on nfs mount) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3057
* nfs: Change NFS3 access op to use access fopShehjar Tikoo2011-07-121-156/+13
| | | | | | | | | | | This change is needed so that we have a uniform dependence on posix-acl for permission checks as well as ACL checks. Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 3057 (acl permissions don't work on nfs mount) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3057
* nfs: convert errno EDQUOT into appropriate nfs-errno.Raghavendra G2011-04-061-0/+4
| | | | | | | | Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Vijay Bellur <vijay@gluster.com> BUG: 2607 (Fileop fails when quota is enabled) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2607
* nfs3: Flush file I/O call states on open failureShehjar Tikoo2011-03-251-8/+22
| | | | | | | | Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2566 (NFS read hangs when arequal-checksum script is run) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2566
* Logging : Use of uuid_utoa and uuid_utoa_r.Gaurav2011-02-041-17/+12
| | | | | | | | 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
* nfs3: Handle root resolution failuresv3.1.2Shehjar Tikoo2011-01-131-9/+9
| | | | | | | | | | | ..to prevent a second reply to the client which results in accessing a call state structure that gets freed on the first reply. Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2286 ([glusterfs 3.1.2qa3]: Crash due to corruption in gf_dirent_free) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2286
* nfs3: Force root lookup before starting fh resolutionv3.1.2qa3Shehjar Tikoo2010-12-291-7/+88
| | | | | | | | Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2200 (cp dies with "Invalid argument" after failover) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2200
* nfs3: Access cbk must account for auxgids on group access checksShehjar Tikoo2010-12-271-4/+17
| | | | | | | | Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2045 (Write permission denied for non-primary group membership) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2045
* 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