summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix.c
Commit message (Collapse)AuthorAgeFilesLines
* storage/posix: prevent chmod() from getting called on symlinksv3.0.7qa1Vijay Bellur2010-12-051-1/+22
| | | | | | | | Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 881 (GlusterFS daemon hangs on replication of symlink (3.0.4)) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=881
* fixes for spurious entry self-heal in afrPranith Kumar K2010-08-131-0/+8
| | | | | | | | Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 974 (Spurious self-heal?) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=974
* Set op_ret to -1 when open fails in posix_openRaghavendra Bhat2010-05-261-0/+1
| | | | | | | | Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 935 (Directories change mode from 0755 to 0644 automatically) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=935
* storage/posix: Use off_t for return value from lseek()Vijay Bellur2010-05-081-4/+8
| | | | | | | | Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 901 (windows iozone causes posix writev to fail) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=901
* Set op_ret to -1 when open fails in posix createv3.0.5rc1Raghavendra Bhat2010-04-271-0/+1
| | | | | | | | Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 825 (when create() races both return success) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=825
* fix posix_utimesRaghavendra Bhat2010-03-251-1/+4
| | | | | | | | | | change utimes to lutimes to prevent errors from symbolic links for linux systems. For non-linux systems keep utimes. Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 34 (No such file or directory on du) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=34
* posix: gen number fixes on non-Linux systemsVijay Bellur2010-03-031-2/+17
| | | | | | | | | | | | Most non-Linux platforms do not support extended attributes on special files and symlinks. Use the mtime as the generation number for these files on such systems Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 621 (3.0.2 GlusterFS fails on Solaris 10) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=621
* storage/posix: Don't use FTW_CONTINUEVikas Gorur2010-02-231-1/+1
| | | | | | | | | | | FTW_CONTINUE is not defined on Mac, and POSIX only specifies that the walker function must return 0. So just return 0. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 625 (Gluster Fails to build on OS X 10.6.2) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=625
* storage/posix: Check for path before logging it in case of an error in ↵Pavan Sondur2010-02-221-13/+32
| | | | | | | | | | xattrop FOP. Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 614 (GlusterFS crashes while printing error if fsetxattr call fails in posix) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=614
* storage/posix: Fix device number handling.Vikas Gorur2010-02-071-6/+23
| | | | | | | | | | | | | | | | | | | There are two fixes in this patch: 1) If the device number has changed, do a fresh stat on the export directory and if it matches the device number of the file, assume a remount happened and remember the new device number as official (this helps automounted export volumes). 2) Don't log the "device number changed" message if it is due to a stat on ".." (in posix_readdirp), as it could be because ".." leads us out of the exported volume. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 576 (crossing device (2056) + fuse LOOKUP error) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=576
* Revert "Server backend storage hang should not cause the mount point to hang."v3.0.2rc1Harshavardhana Ranganath2010-01-261-136/+5
| | | | | | | | | | This reverts commit a0b148ea4e2a0163548eeb89b7580be4adbb8070. Signed-off-by: Harshavardhana <harsha@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 272 (Server backend storage hang should not cause the mount point to hang) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=272
* storage/posix: Fix an access-after-free bug in release() and releasedir().v3.0.1Vikas Gorur2010-01-251-17/+15
| | | | | | | | Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 533 (close() should not block main loop) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=533
* Server backend storage hang should not cause the mount point to hang.Anand Avati2010-01-231-5/+136
| | | | | | | | | | | | | | | | | | | Submitted-by: Krishna Srinivas <krishna@gluster.com> NOTE: fixed compilation issues in posix.c introduced while merging storage/posix polls for FS/kernel being functional by issuing statvfs() call. In case statvfs expires the timer, storage/posix will send CHILD_DOWN to upper translator. Ultimately this will cause protocol/server to disconnect all clients connected and also cleans up the data structures. Hence if soft lockup or other kernel bug causes backend FS to hang, the clients will not be hung. Signed-off-by: Krishna Srinivas <krishna@gluster.com> Signed-off-by: Anand V. Avati <avati@blackhole.gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 272 (Server backend storage hang should not cause the mount point to hang) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=272
* storage/posix: Make the janitor sleep duration configurable.v3.0.1rc2Vikas Gorur2010-01-211-12/+33
| | | | | | | | Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 533 (close() should not block main loop) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=533
* storage/posix: Hand off calling close() and closedir() to the janitor thread.Vikas Gorur2010-01-191-33/+75
| | | | | | | | | | | | Let the janitor thread handle calling close() and closedir() on fd's and DIR * when posix_release is called. This avoids blocking the main server loop due to close(). Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 533 (close() should not block main loop) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=533
* storage/posix: Zero out the checksum array in rchecksum.Vikas Gorur2009-12-281-0/+2
| | | | | | | | | | | Set the checksum bytes to zero to ensure random junk is not returned as the checksum. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 320 (Improve self-heal performance) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=320
* fix typo in posixCsaba Henk2009-12-141-1/+1
| | | | Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
* posix_rchecksum() - fix leak of read bufferAnand Avati2009-12-041-0/+2
| | | | | | | | Signed-off-by: Anand V. Avati <avati@blackhole.gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 320 (Improve self-heal performance) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=320
* storage/posix: Fix Leak in posix_getxattr while filtering gen-number xattr.Pavan Sondur2009-12-031-0/+2
| | | | | | | | Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 315 (generation number support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=315
* storage/posix: Change janitor sleep duration to 10 minutes.Vikas Gorur2009-12-031-1/+1
| | | | | | | | Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 227 (replicate selfheal does not remove directory with contents in it) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=227
* storage/posix: Filter out generation number xattr.Vikas Gorur2009-12-031-1/+6
| | | | | | | | | | | | Don't return the generation number xattr "trusted.<volname>.gen" in getxattr, since this can cause replicate self-heal to copy it over to another subvolume. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 315 (generation number support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=315
* storage/posix: Added janitor thread.Vikas Gorur2009-12-021-1/+114
| | | | | | | | | | | | | | | | | | The janitor thread deletes all files and directories in the "/" GF_REPLICATE_TRASH_DIR directory. This directory is used by replicate self-heal to dump files and directories it deletes. This is needed because letting replicate walk the directory tree and delete a directory and all its children is too racy. Instead, replicate self-heal only does an atomic rename(), and the janitor thread takes care of actually deleting them. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 227 (replicate selfheal does not remove directory with contents in it) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=227
* storage/posix: Fix condition typo.Vikas Gorur2009-11-201-1/+1
| | | | | | | | | | | Do comparision instead of assignment in if-condition in posix_link. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 254 (storage/posix has to do inode number transformation wherever it unwinds with a stat structure) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=254
* fixing a crash in posix (on 32bit)Amar Tumballi2009-11-161-1/+3
| | | | | | | | | | | | fd_ctx_get () was getting passed with type punned argument, now corrected by passing the right argument, and doing the typecasting later Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 383 (glusterfs server crash on 2.0.8) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=383
* Wrong variable is checked after stat call.Sachidananda2009-11-031-2/+2
| | | | | | | | Signed-off-by: Sachidananda <sac@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 355 (Wrong variable checked after a stat call) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=355
* storage/posix: Changed error message displayed for option background-unlink.Vijay Bellur2009-11-021-1/+1
| | | | | | | | Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 352 (Wrong message logged for option `background-unlink') URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=352
* storage/posix: Serialize do_xattrop.Vikas Gorur2009-10-291-45/+58
| | | | | | | | | | | | | Hold a lock on the inode for the getxattr/add-array/setxattr section since multiple threads can enter into it causing wrong values to be written and triggering spurious replicate self-heal later. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 326 ([2.0.8rc9] Spurious self-heal) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=326
* storage/posix: Refactor xattropVikas Gorur2009-10-291-122/+64
| | | | | | | | | | Move common code into do_xattrop. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 326 ([2.0.8rc9] Spurious self-heal) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=326
* posix: posix_[f]setattr() handle valid=0 case by performing {f, l}chown (-1, -1)Anand Avati2009-10-281-0/+24
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 146 (Add setattr FOP) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=146
* storage/posix: Ensure time(2) is stored in a 64-bit variable.Vikas Gorur2009-10-261-1/+3
| | | | | | | | | | | Before multiplying the time_t value by 2^32, store it in a 64-bit variable. This is necessary on 32-bit systems, where time_t is only 32-bits, and left-shifting by 32 results in 0. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 315 (generation number support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=315
* storage/posix: Set right the op_ret value from posix_readlink()Vijay Bellur2009-10-181-4/+6
| | | | | | | | | | Since op_ret was being returned as 0, fuse would regard the readlink () as a failure. Also, set right the buffer size of gen_key in posix_{f, l}stat_with_gen. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 315 (generation number support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=315
* posix: posix_{f, l}stat_with_gen to return 0 on success (instead of >= 0)Anand V. Avati2009-10-161-0/+2
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 315 (generation number support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=315
* posix - generation number supportAnand V. Avati2009-10-161-294/+222
| | | | | | | | | | - use sequential gen counter - move span_devices handling and generation assignment to common functions Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 315 (generation number support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=315
* posix - use lchown and lchmod in setattrAnand V. Avati2009-10-161-2/+2
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 315 (generation number support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=315
* storage/posix: Use the right macro to set nsec of mtime in posix_do_utimesVijay Bellur2009-10-151-1/+1
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 296 (handle futimes correctly in FUSE) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=296
* storage/posix: Initialize op_errno to 0 in posix_create.Vijay Bellur2009-10-151-1/+1
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 309 (In replicate set-up when exnihilate.sh is run , client crashes.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=309
* posix/client/server: Send postparent in lookup even if lookup fails on the ↵Vikas Gorur2009-10-131-2/+6
| | | | | | | | | entry itself. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 137 (Parent directory mtime not reset after a create in self-heal) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=137
* posix: Ensure ENOTEMPTY return on rmdirShehjar Tikoo2009-10-091-1/+4
| | | | | | | | | | | | | | | Since we added an extra step after rmdir, i.e. the lstat on parent dir as part of the NFS-friendly changes, the successful return from postparent lstat clobbers the -1 error return from rmdir. This prevents this particularly ENOTEMPTY error from being propagated to higher translators. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 145 (NFSv3 related additions to 2.1 task list) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=145
* Changed occurrences of Z Research to Gluster.Vijay Bellur2009-10-071-1/+1
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* posix: Support readdirp fopShehjar Tikoo2009-10-061-16/+38
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 292 (Separate readdirp functionality from readdir fop) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=292
* storage/posix: Process "glusterfs.content" key in lookup only for regular files.Vikas Gorur2009-10-061-1/+3
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 301 (lookup should ignore ISDIR error when trying to get content) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=301
* storage/posix: Change STACK_UNWIND to STACK_UNWIND_STRICT.Vikas Gorur2009-10-051-49/+59
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 269 (Add a specialized STACK_UNWIND macro for each FOP) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=269
* posix: NFS-friendly logic changesShehjar Tikoo2009-10-011-26/+393
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 145 (NFSv3 related additions to 2.1 task list) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=145
* Global: NFS-friendly prototype changesShehjar Tikoo2009-10-011-1/+1
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 145 (NFSv3 related additions to 2.1 task list) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=145
* Global: Introduce setattr and fsetattr fopsShehjar Tikoo2009-10-011-331/+265
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 146 (Add setattr FOP) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=146
* storage/posix: Implement rchecksum.Vikas Gorur2009-09-221-0/+66
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* storage/posix: Update nr_files after system call succeeds.Vikas Gorur2009-09-221-12/+12
| | | | | | | | | | In posix_open(), posix_create(), and posix_close(), update stats->nr_files only after the FOP has succeeded. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 248 (Updating stats in posix is incorrect) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=248
* storage/posix: transform inode number in stat structureRaghavendra G2009-09-151-133/+446
| | | | | | | | | | - when export directory is configured to span across multiple mountpoints, the inode number has to be transformed in order to make it unique. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 254 (storage/posix has to do inode number transformation wherever it unwinds with a stat structure) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=254
* storage/posix: Synchronize access to this->private.Vikas Gorur2009-09-081-23/+50
| | | | | | | | | Hold lock on priv while updating variables inside it. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 175 (Statistics for number of open files in Posix incorrect) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=175
* storage/posix: Handle setgid bit on directories correctlyVikas Gorur2009-09-081-10/+108
| | | | | | | | | | | If a directory has the setgid bit set, then any entry created under it must have group ownership same as the directory. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 241 (Gluster not honouring SETGID flag) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=241