summaryrefslogtreecommitdiffstats
path: root/xlators
Commit message (Collapse)AuthorAgeFilesLines
* local->loc should be filled in dht-mknod()Amar Tumballi2009-06-181-0/+9
| | | | | | | local->loc should be properly filled while creating a linkfile. otherwise this causes the segfault in underlying volume layer (mostly client-protocol). Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* making dht and nufa's 'min-free-disk' option to take both percent and disk-sizeAmar Tumballi2009-06-184-38/+90
| | | | | | | | | | | Originally from Paul Rawson <plrca2@gmail.com> http://patches.gluster.com/patch/391/ : patch re-submitted with patching guidelines. cluster/distribute, and cluster/nufa uses new option PERCENT_OR_SIZET for its option 'min-free-disk'. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* change the log level of disk full message in dht-diskusageAmar Tumballi2009-06-181-3/+3
| | | | | | | | the current msg is getting printed in warning level. Instead changed it to debug, as the msg specific each node being full is already getting printed in higher priority, hence this msg looks excessive. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* change ha-statfs() to handle the case of loc->inode being NULLAmar Tumballi2009-06-172-27/+44
| | | | | | | | | | This fix is needed in ha_statfs(), as the current code doesn't handle the case of loc->inode being NULL, which is a valid case in statfs() [Remember its stateless call]. This was causing 100% disk full logs in distribute or nufa as the logic of checking whether the subvolumes have enough disk space on them used to fail. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* client: Replace saved_fds dict with listShehjar Tikoo2009-06-152-158/+177
| | | | | | | | | | | Thhie change removes a huge inefficiency in file open path where every open resulted in dictionary operations in order to let the client maintain a list of fd_t's being used over a particular client context. Resolves: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=16 Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* libglusterfs: Turn fd-table O(1)Shehjar Tikoo2009-06-151-16/+16
| | | | | | | | | This commit reduces CPU usage of gf_fd_unused_get drastically by making it O(1) instead of O(n). Related to: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=16 Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* write-behind: fix memory corruptionRaghavendra G2009-06-151-0/+1
| | | | | | | | - wb_sync did not set local = NULL after stack_wind. It also used to free local if its not NULL as part of cleanup process. Hence there was a double free in STACK_DESTROY done in wb_sync_cbk. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* write-behind: check for memory allocation failures and take appropriate actionRaghavendra G2009-06-151-78/+434
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* Do stat to check mode of the export directory in storage/posix.Vikas Gorur2009-06-151-1/+1
| | | | | | | Doing an lstat means init fails if the export directory is a symlink pointing to a directory. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* io-cache: fix warning by initializing conf = NULLAnand V. Avati2009-06-151-1/+1
|
* read-ahead: fix warning by initializing conf = NULLAnand V. Avati2009-06-151-1/+1
|
* strict check of extended attribute flags while opening a striped fileAmar Tumballi2009-06-112-68/+223
| | | | | | | | | | Added a fd_ctx structure for stripe, which takes care of understanding the extended attribute flags, and opening the right blocks in order (to make sure the read/write operations happen in order). Helps to handle situations like accidentally adding subvolumes to stripe, etc Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* stripe: don't allow entry modification operations when any node is downAmar Tumballi2009-06-111-5/+13
| | | | | | | | if entry modification operations (like create/mknod/rename) happen when there is a node down, there will be inconsistency in striped fs. rather than curing it, prevent the issue from happening Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* stripe cleanupAmar Tumballi2009-06-113-2621/+2759
| | | | | | | | | | | | | stripe.c: indentation cleanup log messages cleanup coding standard guidelines removed ERR_ABORTs stripe.h moved the structure definitions here Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* io-cache: handle memory allocation failuresRaghavendra G2009-06-114-65/+373
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* Implemented LOG MOP in server-protocol.Vikas Gorur2009-06-111-0/+28
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* Implemented LOG MOP in client-protocol.Vikas Gorur2009-06-111-0/+61
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* Do not fail over readdir in replicate.Vikas Gorur2009-06-111-27/+4
| | | | | | | | | If readdir fails on a subvolume, do not fail-over to the next subvolume, since the order of entries and offsets won't be same on all subvolumes. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* Do itransform on every entry in readdir_cbk.Vikas Gorur2009-06-111-4/+9
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* Filter out changelog xattrs in replicate.Vikas Gorur2009-06-111-1/+64
| | | | | | | | The AFR changelog xattrs, "trusted.afr.*" are now filtered and prevented from being visible on the mountpoint. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* io-threads: Fix missed notification in sem_timedwaitShehjar Tikoo2009-06-112-5/+4
| | | | | | | | | | | | | | | We're performing a calculation for skewing idle time that resulted in a timespec.tv_nsec value becoming larger than 1000 million or less than 0, forcing sem_timedwait to return with an EINVAL instead of waiting for a request notification from sem_post in iot_notify_worker(). This resulted in a missed notification that resulted in a hang followed by a timeout on the protocol/client side. This commit avoids the over- and under-flow in tv_nsec by skewing the tv_sec value instead. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* read-ahead: handle memory allocation failuresRaghavendra G2009-06-113-17/+111
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* read-ahead: return with error code EBADF for fops on fds without file set in ↵Raghavendra G2009-06-111-11/+45
| | | | | | | | | | | their context. - since a successful open/create will _always_ set a pointer to ra_file_t in context of fd, this fix makes sense. - an example of operations on bad fd can be afr sending read on the child which was down during open. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* read-ahead: unwind with a return value of -1 and error code of ENOMEM on ↵Raghavendra G2009-06-111-0/+4
| | | | | | memory allocation for ra_file in open/create Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* removed unused option 'page-size' in io-cacheAmar Tumballi2009-06-091-5/+0
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* Print PID after daemonizing glusterfs.Vikas Gorur2009-06-091-6/+10
| | | | | | | | | | PID used to be printed before glusterfs became a daemon, which is incorrect since becoming a daemon involves forking and thus the PID changes. Fixes bug #8. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* server-helpers: cleanup connection only if there are no active transports.Raghavendra G2009-06-083-129/+194
| | | | | | | | | | | - thanks to Ioannis Aslanidis <iaslanidis@flumotion.com> for reporting. - breakup the server_connection_cleanup into smaller procedures. - do following operations in a single atomic operation. 1. conn->active_transports-- 2. collecting pointer to lock table and all fds if there are no active transports this will avoid any race conditions. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* Fix crash in afr data self heal. Bugzilla ID: 3Vikas Gorur2009-06-081-0/+2
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* io-cache: prevent frames from getting woken up while page is getting validatedAnand Avati2009-06-031-1/+1
| | | | | | | | | | | | | | | | 1. A page will be put on the inode waitq if the 'freshness' has to be verified with an fstat() 2. while the fstat is in transit, other calls (like lookup) can update ioc_inode->tv, resetting the freshness (page still on inode waitq) 3. Another read request on the same page, after the updated freshness, will wake up the page frames neglecting the fact that the page is also waiting on the inode (waiting for the fstat completion) 4. once the page's frames are woken, the page becomes elegible for purging and can get destroyed for various reasons, leaving a destroyed page pointer in the inode's waitq 5. fstat returns and hits the destroyed page pointer causing a crash The fix is to all together disable cache hits when any page of the same inode is under validation. The otherwise cache hit will now be subjected to the ongoing validation by getting queued to the inode waitq. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* unify getdents count reduced to 512 (from 1024)Amar Tumballi2009-06-031-1/+1
| | | | | | | | | | | | Thanks to Krishna <krishna (at) gluster.com> for pointing this out. When a unify self-heal of large directory (directory with lot of entries) is done, the getdents_cbk used to fail because of new limit of buffer size (128KB). Noticed that earlier it used to streach upto 4MB, hence the value 1024 worked fine. By reducing it to 512, noticed, we can fit in well within 128KB limit, and hence unify self-heal goes through. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* bug fix in dht-diskusage when statvfs->f_blocks is 0Amar Tumballi2009-06-021-2/+3
| | | | | | | This can happen when 'option export-statfs-size off' is given in posix volume. Caused divide by 0 error. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* Do itransform in AFR readdir.Vikas Gorur2009-05-261-3/+10
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* Always do itransform of the inode number from the first up child.Vikas Gorur2009-05-261-8/+17
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* Preserve atime/mtime during data self heal.Vikas Gorur2009-05-261-8/+51
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* THIS: bootstrap @THIS in fuse threadAnand V. Avati2009-05-221-0/+2
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* THIS: unify now uses xlator_notify for setting THISAnand V. Avati2009-05-221-1/+1
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* THIS: protocol/client now uses xlator_notify for setting THISAnand V. Avati2009-05-221-12/+9
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* mem-pool,io-threads: Destroy mem-pool on deallocationShehjar Tikoo2009-05-211-0/+1
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* add xlator debug/io-statsCsaba Henk2009-05-204-1/+1534
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* io-threads: Use boolean enums instead of integer 1Shehjar Tikoo2009-05-201-2/+2
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* io-threads: Change mutexes/condvars to spinlocks/semaphoresShehjar Tikoo2009-05-202-36/+80
| | | | | | | | | | | | | | | | | It seems that use of mutexes is resulting in pretty high thread sleep and wake-up cost. What is worse, if a worker thread has acquired a lock, there is a possibility of the main glusterfs thread being put to sleep. We change the use of mutexes into spinlock. At the same time, we cannot anymore use condvars for notification since the condvar interface depends on mutexes itself. Semaphores come to out rescue. Luckily, even the pthread semaphores have a timedwait interface to allow our idle worker threads to make an exit decision. Further, it is possible that spinlocks are not available on all systems so all this is curtained behind #defines so we can fall back to mutexes and condvars implementation. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* io-threads: Reduce default max for threads to 64Shehjar Tikoo2009-05-201-1/+1
| | | | | | | | | We've had complaints from users who've used autoscaling option with default settings for min and max threads, about high memory consumption because of the large default value for max-threads. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* io-threads: Support mem-pool allocator for iot_request_tShehjar Tikoo2009-05-202-23/+44
| | | | | | | | | | | | | | | | This commit brings in support for allocation of iot_request_t's in io-threads through the use of the mem-pool. We're hoping that the overheads of hundreds and thousands of small allocations can be avoided through this. The important point to note is that the memory pool is not for the translator as a whole but there is one small memory pool for each worker thread. Not only does that help us avoid malloc overheads for small allocations like iot_request_t but also avoid contention on the heap data structures when multiple threads want an iot_request_t from the pool. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* io-threads: Add graceful shutdown of worker threadsRaghavendra G2009-05-202-25/+79
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* io-threads: handle memory allocation failuresRaghavendra G2009-05-201-197/+760
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* Change errno to EAGAIN in readv/writevVikas Gorur2009-05-191-6/+7
| | | | | | | | When mandatory locks are enabled and a read/write would block due to a lock and if the fd is opened with O_NONBLOCK, return EAGAIN (previously EWOULDBLOCK). Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* Bug fix in pl_readv/writev to handle the mandatory lock case properly.Vikas Gorur2009-05-181-23/+21
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* client-protocol: Fix memory corruption in client_lookupRaghavendra G2009-05-161-13/+7
| | | | | | | | - memory corruption was due to new members being added between allocation of buffer for serializing xattr_req dictionary and dict_serialize of xattr_req. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* make getxattr fail with ERANGE if reply is bigger than what was requestedCsaba Henk2009-05-161-31/+25
| | | | | | Edited by avati: make the function signature of fuse_xattr_reply_buf() use 'const char *value' instead of 'char *value' Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* avoid duplicate mounts while using mount.glusterfsAmar Tumballi2009-05-161-1/+1
| | | | | | | This change is needed as the format of how the /etc/mtab entry of glusterfs mount looks is now changed. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>