summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/nfs-common.c
Commit message (Collapse)AuthorAgeFilesLines
* 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-1/+1
| | | | | | | | | | | | 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: do not change root inode if enable-ino32 is setRajesh Amaravathi2012-11-181-0/+3
| | | | | | | | | | | | | | | | When a user sets nfs.enable-ino32 on, the root inode, which must be 1, is jumbled during hashing of the gfid into 32 bits. This patch avoids doing that, and returns inode of 1 for the root inode. Change-Id: Ib65f2660998a95e1059be32bc298485c5cbe52df BUG: 864222 Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com> Reviewed-on: http://review.gluster.org/4154 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* nfs: resolve parent inode during inode_loc_fillRajesh Amaravathi2012-11-121-0/+2
| | | | | | | | | | | | This commit resolves the parent inode in nfs_inode_loc_fill if the inode has a resolved path. Change-Id: If407c91c246b0b9f3349cedae0baec8bd6831d10 BUG: 872923 Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com> Reviewed-on: http://review.gluster.org/4157 Reviewed-by: Krishna Srinivas <krishna.zresearch@gmail.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* nfs: do lookup on getattr after brick-status changeJeff Darcy2012-10-191-0/+35
| | | | | | | | | | | | | By doing a lookup, we get a chance to do all of the self-heal checks that would occur if we were using native protocol, and return proper status if the self-heal fails. Best of all, we don't need to misrepresent times. Change-Id: I76477d1e5fce4d83e4029e02fcdd71e81e23110d BUG: 830134 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/4058 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* remove useless if-before-free (and free-like) functionsJim Meyering2012-07-131-4/+2
| | | | | | | | | | | | See comments in http://bugzilla.redhat.com/839925 for the code to perform this change. Signed-off-by: Jim Meyering <meyering@redhat.com> BUG: 839925 Change-Id: I10e4ecff16c3749fe17c2831c516737e08a3205a Reviewed-on: http://review.gluster.com/3661 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* nfs-common: don't let 0-length path cause buf[-1] accessJim Meyering2012-07-111-2/+2
| | | | | | | | | Change-Id: I5f0e93448a954aff1ff08a0980fb9bfd60e63988 BUG: 789278 Signed-off-by: Jim Meyering <meyering@redhat.com> Reviewed-on: http://review.gluster.com/3594 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* nfs: do not call inode_path on the newly created inodeRaghavendra Bhat2012-03-141-5/+18
| | | | | | | | | | | | | | | | | | | | | | While resolving, for building the path into the loc, inode_find is called with gfid as argument to get the inode from the inode table. If the inode is not found, then a new inode is created. Then the path is build using inode_path. But if the inode is not linked to inode table (newly created inode), then gfid will be null and inode_path returns null gfid as the path. Suppose the lookup operation on that gfid fails, then we print the null gfid in the log message. To avoid it, build the path using the gfid only if inode_path fails. Change-Id: I2506fa8675761ddb0bc02980cd3583d9d068fc85 BUG: 802424 Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Reviewed-on: http://review.gluster.com/2930 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* nfs: changes for using nameless lookup and anonymous FDsAnand Avati2012-01-201-73/+48
| | | | | | | | | | | | | | - 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>
* core: remove 'ino' variable from 'inode_t' structureAmar Tumballi2011-11-161-6/+1
| | | | | | | | Change-Id: I0f078d1753db65d2f2e0380d1b0450c114cf40dd BUG: 3518 Reviewed-on: http://review.gluster.com/522 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* NFS: logging enhancement.Gaurav2011-11-161-6/+24
| | | | | | | | | 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>
* Fix memleaks in NFSkrishna2011-11-151-1/+1
| | | | | | | | | Change-Id: I522d4bad71d1e914fa88367f70f5e8c28d64fbbe BUG: 3542 Reviewed-on: http://review.gluster.com/533 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@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>
* nfs/server: unrefing inodes on error in nfs_loc_copy ().Mohammed Junaid Ahmed2010-12-291-0/+8
| | | | | | | | Signed-off-by: Junaid <junaid@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2252 (unreffing of inodes not done when memory allocation fails) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2252
* nfs: Introduce nfs.enable-ino32 to support legacy 32-bit only appsShehjar Tikoo2010-10-291-0/+32
| | | | | | | | Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1972 (xcs get doesn't work with gNFS) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1972
* nfs: Revert downed-subvolume changesShehjar Tikoo2010-10-071-42/+0
| | | | | | | | | | | | | | | | | | | For the record these are the patches committed as: 1. "nfs, nfs3: Base volume access on CHILD-UP-DOWN event" http://git.gluster.com/?p=glusterfs.git;a=commit;h=f47b0c55de9941823fbefe4b3a7e37179d6d4329 2. "nfs: Fix multiple subvolume CHILD-UP support" http://git.gluster.com/?p=glusterfs.git;a=commit;h=336e2df7b74be7ad4c9ed403ca10b9f7f7ef9a58 3. "nfs,nfs3: Disable subvolume on ENOTCONN" http://git.gluster.com/?p=glusterfs.git;a=commit;h=8c6e27cdaf895e3031c3256efb9472a6c0bf61f3 Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1724 (kernel untar fails during add-brick) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1724
* 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
* nfs, nfs3: Base volume access on CHILD-UP-DOWN eventShehjar Tikoo2010-09-221-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Overall, the aim of this patch is to change the result of an nfs op depending on whether the underlying volume is up or down as notified by CHILD_UP and CHILD_DOWN events. This patch contains three intertwined changes: o Only when the lookup on the root of a volume is successful does gnfs now export the subvolume. Till now the result of the lookup was not used to determine whether we should export that volume. Not accounting for root lookup failure resulted in ESTALEs on first access because some children of distribute were down at the time of the root lookup. o Only when lookups on all the subvolumes have succeeded are these exports enabled through NFS. o When a child of say distribute goes down, on CHILD_DOWN event nfs will ignore all incoming requests from the client because ignoring these will prevent ESTALEs for those requests and in the hope that ignoring the requests will make the client retransmit. There are risks in this approach absent the DRC but we're willing to live with that for now. When a child goes down, the mount exports list will continue to show it but mount requests will be denied. Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1643 (Initial requests after mount ESTALE if DHT subvolumes connect after nfs startup) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1643
* nfs,nfs3,mnt3: Transition fh resolution to gfidShehjar Tikoo2010-09-141-5/+15
| | | | | | | | 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
* nfs: Fine tune nfs_entry_loc_fill return valuesShehjar Tikoo2010-05-101-4/+12
| | | | | | | | | | | | | | A previous change to this function introduced a regression for exclusive creates. This patch fixes the regression by bringing the return values in line with what the callers expect in different situations of loc filling. Signed-off-by: Shehjar Tikoo <shehjart@dev.gluster.com> Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 857 (Crash in afr_sh_entry_expunge_entry_cbk) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=857
* nfs: Handle failed parent loc fillingShehjar Tikoo2010-05-081-6/+6
| | | | | | | | | | | | | Just because an inode_get for parent (ino, gen) returns a valid inode_t does not meant that the inode_path(..in nfs_parent_inode_loc_fill..) will return successfully. The failure of nfs_parent_inode_loc_fill was not handled resulting in a NULL path being passed for the fop. Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 857 (Crash in afr_sh_entry_expunge_entry_cbk) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=857
* Memory accounting changesVijay Bellur2010-04-231-5/+6
| | | | | | | | | | | Memory accounting Changes. Thanks to Vinayak Hegde and Csaba Henk for their contributions. Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 329 (Replacing memory allocation functions with mem-type functions) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=329
* nfs: Add generic nfs translatorShehjar Tikoo2010-03-311-0/+379
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