summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* configure.ac: print summary to stdoutAnand V. Avati2009-06-091-2/+0
|
* 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>
* libglusterfsclient: Avoid dirent copies in readdir cbkShehjar Tikoo2009-06-082-7/+16
| | | | | | | | | We can avoid memory allocation, de-allocation and data copies by just using the entries passed to us from a lower layer and by de-linking the entries from the original list. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* libglusterfs: Add empty and NULL dirents list checksShehjar Tikoo2009-06-082-0/+12
| | | | | | | | | | | | These checks are needed in case a higher layer intends to delink the dirent list and passes a NULL pointer to fop_readdir_cbk_stub for the entries parameter. Consequently, the gf_dirent_free must guard against an empty list because the stub that is passed to it mgiht have an empty dirent list. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* ib-verbs error log enhancementAmar Tumballi2009-06-031-3/+10
| | | | | | | | | | | | | Earlier it was thought that only not having 'opensm' running will cause handshake errors in ib-verbs. Recently understood that even having a wrong 'ib-verbs.port' option can also cause the same behavior, and it took more than 5-6 e-mail iterations with the user and lot of brain cycle in support team to understand the problem. Made the log message more descriptive, so user can be find the cause, or can send us email without wasting time. 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>
* libglusterfsclient: Increase readdir block sizeShehjar Tikoo2009-06-031-1/+1
| | | | | | | | | | | | | | This improves the potential for pre-fetching a larger number of dirents. Consider that, with 255 chars as the max name length for each dirent, in the worst case scenario, where we actually have files with such large names, we're not getting more than 4 entries with the current block size of 1024. Generally also, increasing the size to 4k provides us with a higher chance that directories with low to medium number of dirents will be pre-fetched in a single readdir fop. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* libglusterfsclient: Add dirent pre-fetching and cachingShehjar Tikoo2009-06-032-64/+215
| | | | | | | | | | | | | | The fop interface is such that we're able to extract more than 1 dirent in a readdir fop. This commit now enables libglusterfsclient to read multiple entries on a glusterfs_readdir call. Once these have been pre-fetched, they're cached till either glusterfs_closedir ,glusterfs_rewinddir or glusterfs_seekdir are called. The current implementation is beneficial for sequential directory reading and probably indifferent to applications that do a lot of seekdir and rewinddir after opening the directory. This is because both these calls result in dirent cache invalidation. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* booster: attr_timeout: Read timeout from booster fstabShehjar Tikoo2009-06-031-0/+17
| | | | | | | | | In order to expose the timeout values for stat and inode caching, this commit introduces a new fstab option "attr_timeout" that defines the number of seconds for which a looked up inode or a stat()'ed structure is valid in the cache. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* libglusterfsclient: Simplify inode and stat cachingShehjar Tikoo2009-06-033-127/+94
| | | | | | | | | There is a mechanism for caching the inode numbers got from a lookup and a struct stat got from a stat or fstat but I wasnt sure if it worked. This commit simplifies cache updates and checks and the accompanying tests have made sure that the cache does work. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* libglusterfsclient: Allocate right sized structureShehjar Tikoo2009-06-031-1/+1
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* booster: Clean-up handling of log/fstab env variablesShehjar Tikoo2009-06-021-5/+14
| | | | | | | | | | | | | Handle two cases when deciding log/fstab file: 1. It turns out that that strdup or strlen doesnt actually check for NULL before trying to do its thing with the string so it seg-faults on seeing a NULL char pointer. 2. getenv can return an empty string if the env var was exported as: $ export GLUSTEFS_BOOSTER_LOG= Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* booster: Eliminate gluster context creation raceShehjar Tikoo2009-06-021-92/+133
| | | | | | | | | | | | When multiple threads try to create a glusterfs context using the glusterfs_init function, those threads end up using the global vairables in the vol file parser in an non-synchronized manner, resulting in a seg-fault. There is now a big lock around searches and additions from the mount table in do_open. This lock granularity could be reduced. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* booster: Clear up env var usageShehjar Tikoo2009-06-021-1/+14
| | | | 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>
* Remove absolute path for init scripts.Harshavardhana2009-05-291-1/+1
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* Fix mismatch in size of used buffer to prevent an infinite loopPavan Sondur2009-05-291-1/+1
| | | | | | A mismatch in the size of the used buffer, between reading and then further writing caused an infinite loop and big files(1Mb, 10Mb etc) could not be downloaded through the lighttpd web service using mod_glusterfs. This is because the big file which is broken up into chunks, has a read and a subsequent write. 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>
* add booster_fstab.h in noinst_HEADERS to fix build breakage after 'make dist'Anand Avati2009-05-261-0/+1
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* ib-verbs: Set receive and send window sizeShehjar Tikoo2009-05-262-0/+57
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* socket: Set receive and send window sizeShehjar Tikoo2009-05-262-0/+72
| | | | | | | This is experimental. We're hoping this improve performance on high speed links like 10GigE. 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>
* fix crash in __socket_reset. Previously iobuf_p was an allocated pointer, ↵Anand Avati2009-05-221-2/+2
| | | | | | but since introduction of IObuf it is no more. Now iobuf has to be unref'ed instead. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* booster: Move fstab parsing into booster from libglusterfstag-release-2.0Shehjar Tikoo2009-05-206-436/+436
| | | | | | | | | | | This is another attempt at fixing build problems on Solaris. I am told that booster build is disabled on Solaris and I know that it is disabled on Mac OS X also. Getting it to work on both these systems is now on my TODO list, mainly because on both these systems, we can have a glusterfs client running without requiring FUSE. 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>
* mem-pool: Restructure mem-pool behaviourShehjar Tikoo2009-05-192-31/+55
| | | | | | | | | | | | | | | | | | This commit changes mem-pool behaviour to return a directly usable address by performing the required adjustment on the address being returned. This is different from the previous behaviour where we're trying to fit into the requested size, the list_head*2 also. This is not efficient enough in terms of space but hopefully works better than not having any mem-pool at all. Besides, I am not comfortable with mem-pool meta-data and caller-useable memory area being the same because of the potential for mem-pool's data structure corruption. PS: Please do read the comments in the code for more info during review. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* mem-pool: Fix #define spellingShehjar Tikoo2009-05-191-3/+3
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* mem-pool: Remove hard coded value for pad boundaryShehjar Tikoo2009-05-191-1/+1
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* mem-pool: Fix memory leak in mem-pool init phaseShehjar Tikoo2009-05-191-1/+3
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* booster: Fall back to remaining real_* functorsShehjar Tikoo2009-05-191-13/+36
| | | | | | | | | It is possible that some of the real_* functors for stat family of syscalls are NULL. I've seen this on libc. In that case, this commit attempts to use any available function that performs an equivalent operation. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* booster: Dont de-init fd tables on VMP-init failureShehjar Tikoo2009-05-191-17/+5
| | | | | | | | In case the init procedure for VMP fails, we want to continue using booster through the old approach, which means leaving the fd-table intact. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* booster: Do not read info for non-glusterfs mount pointsShehjar Tikoo2009-05-191-0/+3
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* Appropriate changes to statvfs struct for Solaris host.Harshavardhana Ranganath2009-05-191-0/+13
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Comply with EEXIST rule on renameShehjar Tikoo2009-05-181-8/+0
| | | | | | | | During a rename, if the new file exists, the old name needs to over-write the new name. We're returning EEXIST, which is wrong behaviour. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: __do_path_resolve: Fix pathname resolution bugShehjar Tikoo2009-05-181-1/+1
| | | | | | | | | | | In __do_path_resolve, we need to use the new_loc.path as the input for resolution rather than the resolved variable, simply because we're not interested in resolving the names that have been resolved, as pointed out by the variable name 'resolved'. Instead, we need to resolve new_loc, which stores the next component in the path to be looked up. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Wipe loc->ino in libgf_client_loc_wipeShehjar Tikoo2009-05-181-0/+1
| | | | | | | | | | | | | | | | Not cleaning up the ino member of a loc_t results in SIGABRT in __inode_link because in some cases, the loc->ino is different from loc->inode->ino. This happens especially in code blocks which re-use a loc_t structure for pointing at different inodes/files. For eg, if a loc_t has been assigned an inode and an ino, and followed by a libgf_client_loc_wipe, then re-use of this loc in say libgf_client_lookup results the SIGABRT because libgf_client_lookup calls inode_link with the same loc_t. However, this loc_t has just been assigned a new inode pointer but the ino member still contains a previous inode's inode number. This difference in inode numbers results in an assertion failure, so the SIGABRT. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* booster: Add telldir APIShehjar Tikoo2009-05-182-0/+38
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* booster: Add seekdir APIShehjar Tikoo2009-05-182-0/+36
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* booster: Add rewinddir APIShehjar Tikoo2009-05-182-0/+37
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Refine readdir entry parsing logicShehjar Tikoo2009-05-181-25/+19
| | | | | | | | Here I am only refining the entry parsing code in order to clarify the exit conditions from the loop. There were a few workloads where this loop went infinite. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add telldir APIShehjar Tikoo2009-05-182-0/+35
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add seekdir APIShehjar Tikoo2009-05-182-0/+32
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add rewinddir APIShehjar Tikoo2009-05-182-1/+33
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Revert and re-do readdir conformanceShehjar Tikoo2009-05-182-61/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit basically reverts the previous readdir conformance patch I sent a few days back. That commit had a completely retarded and broken way of maintaining per-directory dirent. It was broken for two reasons: 1. Creating a wrapper structure around the directory's fd_t only for storing a struct dirent is not clean enough. This commit takes a better approach by storing the dirent in fd_t context. This dirent is valid only if the fd_t refers to a directory. 2. That commit was made and tested under the assumption (..stupidity is a better word..) that only opendir call is used for opening a directory. That is not correct. Directories are also opened using the open syscall. The point is, glusterfs_open returns an fd_t and so did glusterfs_opendir. The previous patch actually changed opendir to return a new wrapper structure. That is fine, if we go by the POSIX definition of open and opendir because, they're both supposed to return different types, an int and a DIR*. However, in libglusterfsclient, all other code assumes that directory handles corresponding to DIR* and file descriptors corresponding to int types are the same type, resulting in use of the same locking and fd context addition/extraction code. So a directory opened using opendir returned a wrapper structure which went down into the libglusterfsclient stack where some function called a lock on the handle assuming it was an fd_t, since it is not and dereferencing of the supposed fd->inode->lock results in a seg fault. Obviously, this didnt show up till unfs3 used open() to open a directory and not opendir. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* booster: Supplement fstab option parsingShehjar Tikoo2009-05-181-6/+14
| | | | | | | | Previous fstab option parsing logic was completely retarded and did not handle all cases. This fixes the situation so we now work without any problems. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* workaround for not including sys/cdefs.h -- including sys/cdefs.h breaks ↵Anand V. Avati2009-05-181-1/+16
| | | | build on solaris and other platforms
* 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>