summaryrefslogtreecommitdiffstats
path: root/xlators
Commit message (Collapse)AuthorAgeFilesLines
* cluster/afr: dir-write: Fix inode number handling.Vikas Gorur2009-09-282-24/+41
| | | | | | | | | | | | | | | | | | | create, mkdir, symlink, mknod: Prefer to return itransform'd inode number from the first_up_child. If not, fall back on any other child that returned succcess. link, rename: Return the same inode number that was passed as part of loc_t. Also adds a new member to afr_local_t, local->first_up_child which is initialized at the start of the transaction. This fixes the race where a subvolume might go down during the transaction and thus have the first_up_child change. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 285 ("first up child" can change during a transaction) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=285
* write-behind: check for NULL file pointer in flush callbackAnand Avati2009-09-241-1/+2
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 260 (ls on booster VMP results in error: "File descriptor in bad state") URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=260
* performance/write-behind: Add NULL checks for file pointer.Raghavendra G2009-09-241-83/+104
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 260 (ls on booster VMP results in error: "File descriptor in bad state") URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=260
* performance/write-behind: Add a NULL check for request->stub before checking ↵Raghavendra G2009-09-241-1/+2
| | | | | | | | | | | | | | | | | request->stub->fop. - for non-write wind requests, the request structure outlives the stub. The call stub is destroyed when stack is wound but request is destroyed only when the reply has come. (for writes, both stub and request are destroyed when refcount becomes 0, which happens only when the write operation is stack unwound and a reply for the write operation has come from underlying translators, for non-write unwind requests the request is first destroyed before resuming the stub). Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 280 (simple stripe, with write-behind set up, when dbench is run client crashes.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=280
* fuse: emit a flush from release if we didn't get an adjacent FLUSH message ↵Csaba Henk2009-09-231-5/+50
| | | | | | | | | from the kernel Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 223 (flush not sent) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=223
* performance/write-behind: store currently aggregated data size in wb_fileRaghavendra G2009-09-231-27/+30
| | | | | | | | | | - this helps us to not traverse the request list whenever we need currently aggregated data in the queue Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 276 (write behind needs to be optimized.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=276
* performance/write-behind: store the current window size in wb_file.Raghavendra G2009-09-231-44/+40
| | | | | | | | | | - this would increase the performance since we don't have to traverse the request list every time we need the current window size. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 276 (write behind needs to be optimized.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=276
* performance/write-behind: reduce usage of iov_length.Raghavendra G2009-09-231-47/+27
| | | | | | | | | | - request structure now holds a member write_size which is initialised at the time of request creation and used later. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 276 (write behind needs to be optimized.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=276
* performance/write-behind: add option "enable-trickling-writes".Raghavendra G2009-09-221-22/+41
| | | | | | | | | | | | | | - With this option enabled, writes are stack-wound even though not enough data is aggregated, provided there are no write-requests which are stack-wound but reply is yet to come. The reason behind this option is to make use of the network, which is relatively free (with no writes or replies in transit). However, with non-standard block-sizes of writes the performance can actually degrade. Hence making this configurable. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 276 (write behind needs to be optimized.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=276
* performance/write-behind: reduce traversal of request list during wb_mark_winds.Raghavendra G2009-09-221-35/+28
| | | | | | | | | | | | | | | | - move all the decision making code to __wb_can_wind. - don't continue traversing the request list, once we know any of the following conditions are true: * requests other than write are present in queue. * writes are happening at non-contiguous offsets. * there are no write requests, which are wound to server but not yet received the reply. * enough data is aggregated for writing. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 276 (write behind needs to be optimized.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=276
* performance/write-behind: reduce list-traversal during wb_mark_unwindsRaghavendra G2009-09-221-13/+19
| | | | | | | | | | - don't traverse entire request list to get the window-size, instead break when current window size becomes greater than configured limit. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 276 (write behind needs to be optimized.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=276
* performance/write-behind: remove redundant traversal of write-requests in ↵Raghavendra G2009-09-221-3/+5
| | | | | | | | | | | | the wind list in wb_sync. - no need of getting the total_count of number of requests in the list. Even if there is a single request, we need to sync it. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 276 (write behind needs to be optimized.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=276
* performance/write-behind: Aggregate adjacent contiguous write-buffers into ↵Raghavendra G2009-09-221-1/+77
| | | | | | | | | single iobuf. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 276 (write behind needs to be optimized.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=276
* performance/write-behind: fine-tune logic of wb_mark_windsRaghavendra G2009-09-221-65/+14
| | | | | | | | | | | | | | | - remove wb_mark_wind_aggregegate_size_aware, since wb_mark_wind_all does the same work (with check for whether current aggregated data size is greater than the configured limit before calling it). Moreover, wb_mark_wind_aggregate_size_aware called __wb_get_aggregate_size redundantly, thereby reducing the performance, since for small sized large number of writes, traversing the list of requests takes significant amount of time. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 276 (write behind needs to be optimized.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=276
* performance/quick-read: refine logic of qr_readv.Raghavendra G2009-09-221-3/+14
| | | | | | | | | | - An extra vector was being allocated when the number of bytes being read from cache were equal to the iobuf size. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 274 (Memory corruption in Apache running on booster) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=274
* performance/quick-read: optimizations to lookupRaghavendra G2009-09-221-24/+49
| | | | | | | | | | | - qr_lookup not to send request for file-content if the cache is already present during revalidates. - flush the cache in qr_lookup_cbk if the cache is not in sync with the file. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 273 (Code review and optimize quick-read) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=273
* performance/quick-read: make a comment more explicit.Raghavendra G2009-09-221-2/+2
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 273 (Code review and optimize quick-read) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=273
* performance/quick-read: checking for qr_file in inode-context and creating ↵Raghavendra G2009-09-221-30/+45
| | | | | | | | | if not present should be atomic. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 273 (Code review and optimize quick-read) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=273
* performance/quick-read: refine the logic in qr_lookup.Raghavendra G2009-09-221-40/+54
| | | | | | | | | | | | | - a new size has to be set in xattr_req only if (quick-read is configured with a maximum file size limit && ((xattr_req does not have a request key for getting content) || (the size requested in xattr_req is not equal to configured size in quick-read))) Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 273 (Code review and optimize quick-read) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=273
* protocol/client: access glusterfs context from the ctx member of xlator objectRaghavendra G2009-09-221-1/+1
| | | | | | | | | | - A global context pointer cannot be used with libglusterfsclient, since there can be many contexts in a single process. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 271 (applications using booster protocol/client crash in client_setvolume_cbk.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=271
* performance/write-behind: check for the presence of context only in fds not ↵Raghavendra G2009-09-221-6/+12
| | | | | | | | | opened on directories. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 260 (ls on booster VMP results in error: "File descriptor in bad state") URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=260
* client-protocol: fix race-condition encountered while accessing fdctxRaghavendra G2009-09-221-47/+218
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - In protocol/client, fdctx is accessed by two sets of procedures, protocol_client_mark_fd_bad falls in one set whereas the other set consists of all fops which receive fd as an argument. The way these fdctxs are got is different in these two sets. While in the former set, fdctx is accessed through conf->saved_fds, which is a list of fdctxs of fds representing opened/created files. In the latter set, fdctxs are got directly from fd through fd_ctx_get(). Now there can be race conditions between two threads executing one procedure from these two sets. As an example let us consider following scenario: A flush operation is timed out and polling thread executing protocol_client_mark_fd_bad, fuse thread executing client_release. This can happen because, immediately a reply for flush is written to fuse, a release on the same fd can be sent to glusterfs and the polling thread still might be doing cleanup. Consider following set of events: 1. fuse thread does fd_ctx_get (fd). 2. polling thread gets the same fdctx but through conf->saved_fds. 3. Now both threads go ahead and does list_del (fdctx) and eventually free fdctx. In other situations the same set events might occur and the threads executing fops other than flush in the second set might be accessing a fdctx freed in protocol_client_mark_fd_bad. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 127 (race-condition in accessing fdctx in protocol/client) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=127
* performance/quick-read: access glusterfs_ctx from xlator instead of using ↵Raghavendra G2009-09-171-1/+1
| | | | | | | | | | | | | | glusterfs_get_ctx - since glusterfs_get_ctx gets the global context pointer, there can be problems in a multithreaded application running on libglusterfsclient doing multiple glusterfs_inits. Hence use context specific to the current xlator tree stored in each xlator object. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 240 (segmentation fault in qr_readv) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=240
* io-cache: fix table->max_pri to 1 as the lowest priorityAnand Avati2009-09-161-1/+2
| | | | | | | | | | | | | patch http://patches.gluster.com/patch/1319/ breaks when no priority is mentioned in the config. the patch makes ioc_get_priority() return 1 as the value when no priority is given, but ioc_get_priority_list() was still returning 0 as the max_pri (maximum priority) which would result in lru list heads not getting initialized Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 261 (support for disabling caching of certain files) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=261
* 2.0.6 patch for io-cache pattern-matched non-cachingStephan von Krawczynski2009-09-151-5/+23
| | | | | | | | | | | | | | | | | | Hello all, here is a small feature patch. Its intention is to give the user more control over the files performance/io-cache really caches. If the user knows exactly which files should be cached and which shouldn't there is currently no way to tell glusterfs _not_ to cache certain pattern. This patch allows you to disable caching by setting the priority of a pattern to "0". If you do not give any priority option it works just like before and caches everything. Honestly I am not totally sure that disabling caching works the way we did it, please comment. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 261 (support for disabling caching of certain files) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=261
* storage/posix: transform inode number in stat structureRaghavendra G2009-09-151-153/+489
| | | | | | | | | | - 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
* backporting quick read to 2.0Raghavendra G2009-09-145-1/+2361
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 238 (Backport quick-read to 2.0 release) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=238
* backport stat-prefetch from 2.1Raghavendra G2009-09-134-385/+1763
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 257 (Backport stat-prefetch to 2.0) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=257
* protocol/server: server_stub_resume should check for failure of lookup when ↵Raghavendra G2009-09-131-1/+2
| | | | | | | | | oldloc.parent is NULL. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 215 (crash on ib-verbs in 2.0.6-rc4) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=215
* cluster/afr: Check op_ret in afr_getxattr_cbk before accessing dictVikas Gorur2009-09-081-1/+2
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 250 (Crash in replicate getxattr) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=250
* performance/write-behind: hold locks when accessing members of wb_file.Raghavendra G2009-09-081-17/+75
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 243 (Hold locks when accessing members of wb_file_t.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=243
* performance/write-behind: communicate back the errors in writes to servers ↵Raghavendra G2009-09-081-1/+12
| | | | | | | | | in the next immediate writes from application. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 242 (If any of the writes fail, write-behind should not wait till the fd is closed for reporting errors) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=242
* 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
* protocol/client: 'connecting' event is properly notified.Amar Tumballi2009-08-202-4/+23
| | | | | | | | | | | when there are no servers available to client, and transport init is not successful, send 'connecting' event once to parent so it doesn't hand in there. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 224 (Client hangs if none of the servers are up) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=224
* in server_rename if we do_path_lookup on the newloc and parent directory is ↵Krishna Srinivas2009-08-191-24/+28
| | | | | | not found, the server crashes. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* fuse: don't say "Success" when mount failsCsaba Henk2009-08-171-2/+3
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 219 (Error message incorrect when fuse_mount() fails) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=219
* added log message when server fails to send the reply frameAmar Tumballi2009-08-171-4/+8
| | | | | | | | | | | | | As of now, if a frame submit fails on server, there are no logs, and clients will have missing frames (which leads to 'hangs'). Supporting situation like this very tricky without proper log messages. As a step to make our log message lean and meaningful, this log is important. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 190 (missing frames due to larger reply message size.. (ib-verbs)) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=190
* filter: use O_ACCMODE for checking file access modes.Raghavendra G2009-08-171-3/+6
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 196 (write-behind window size getting set to 0.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=196
* read-ahead: use O_ACCMODE for checking file access modes.Raghavendra G2009-08-171-2/+2
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 196 (write-behind window size getting set to 0.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=196
* write-behind: use O_ACCMODE while checking for O_RDONLY in flags.Raghavendra G2009-08-171-2/+2
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 196 (write-behind window size getting set to 0.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=196
* features/locks: Fix reverse logic in posix_lock_to_flockVikas Gorur2009-08-171-2/+2
| | | | | | | | | if the lock's end point is LLONG_MAX, the corresponding struct flock's len must be 0. Previous code had LLONG_MAX and 0 reversed. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* mount/fuse: Don't log setlk returning EAGAIN as a GF_LOG_ERROR.Vikas Gorur2009-08-171-2/+2
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* features/locks: Set the right log level in a few places.Vikas Gorur2009-08-172-13/+13
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* Filter changelog xattrs in replicatev2.0.6Vikas Gorur2009-08-071-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> BUG: 9 (replicate's pending xattr's should not be visible on the mountpoint) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=9
* protocol/client: fixed registration of saved_fdsAnand Avati2009-08-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | In client_open_cbk, client_opendir_cbk the list_add_tail macros were invoked with wrong ordered arguments, causing the existing registered fd list to get unlinked from the saved_fds list. The effects of this is far fetched - when transport disconnects, open fds are no more marked bad as they are not reachable from the saved_fds list. After reconnection, resumed access on this fd causes reference to invalid fds on the server. It could appear in the form of 'unresolved fd' error, readdir happening on a file fd, files reading from other files, etc. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 192 (sefault in posix-readdir) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=192 BUG: 126 (Immediate segfault when used for rootfs) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=126 BUG: 173 ([ glusterfs 2.0.6rc1 ] - "server SEG fault") URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=173 BUG: 194 (Apache+Booster results in inconsistent download size using wget) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=194
* server-lookup: added path info from header to log messageAmar Tumballi2009-08-041-3/+4
| | | | | | | | | | | | in the previous commit, the path info was removed to prevent the segfault, which instead could have been provided from request header directly. More specific information is required for debugging, and hence adding the path log. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 189 (segfault in server-lookup) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=189
* dht_stat_merge - use the highest uid when ambiguousAnand Avati2009-08-041-2/+3
| | | | | | | | | When directories on different subvolumes have different ownerships, use the highest uid/gid till self-heal resolves the inconsistency Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 191 (random Permission denied errors) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=191
* add check for making sure 'fd' belongs to directory in posix-readdirAmar Tumballi2009-08-041-0/+7
| | | | | | | | | | | The root cause of this error is not found yet. But this check will make sure that there is no crash when the situation happens. Segfault can happen when a readdir() call comes over file's fd. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 192 (sefault in posix-readdir) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=192
* adding an option to mount.glusterfs for server failover while fetching ↵Amar Tumballi2009-08-041-13/+25
| | | | | | | | | | | | | | volume files. Thanks to Cory Meyer <cory.meyer@gmail.com> With this option, 'single point of failure', in case of volfile server can be avoided. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 185 (Request to support secondary volfile-server option in mount.glusterfs) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=185
* logging related bug fix in server_lookup()Amar Tumballi2009-08-041-4/+3
| | | | | | | | | | | | When 'dict_unserialize' failed, the log message was trying to print 'state->loc.path' and 'state->ino', which gets filled in later stages in flow. Caused segmentation fault when there was a failure. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 189 (segfault in server-lookup) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=189