summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* build: consolidate common compilation flags into one variableJeff Darcy2012-10-0148-55/+55
| | | | | | | | | | | | | | | Some -D flags are present in all files, so collect them. This adds -D${GF_HOST_OS} to some compiler command lines, but this should not be a problem. Change-Id: I1aeb346143d4984c9cc4f2750c465ce09af1e6ca BUG: 862082 Original-author: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/4013 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* build: add missing GF_CFLAGS in api/src/Jeff Darcy2012-10-012-2/+1
| | | | | | | | | | | | | | | | GF_CFLAGS seems missing in two spots. In one of those, adding it to libgfapi_la_CFLAGS would make it equal to AM_CFLAGS, so remove libgfapi_la_CFLAGS there. Change-Id: I50c22f16210ecd40371d4abb0e418c7a4f94c12f BUG: 862082 Original-author: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/4009 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* linux-aio: fixes while setting O_DIRECT flagAnand Avati2012-10-013-38/+60
| | | | | | | | | | | | | | | | | | | | Linux AIO needs O_DIRECT to be set for effective operation. O_DIRECT in turn has constraints on when it can work (offset, size alignment) So use O_DIRECT (unless instructed by application) only when offset and size alignments match. Else, io_submit() will happen over non-O_DIRECT fd, effectively blocking till the completion of the IO. Also fix a multithreading bug where detection/setting of O_DIRECT for a request was not atomic with io_submit() of that request. Change-Id: I190017e8bc78217429aff0714dca224cbe6f251d BUG: 837495 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/4006 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Tested-by: Amar Tumballi <amarts@redhat.com>
* Fix problems of mismatch type.linbaiye2012-10-012-5/+6
| | | | | | | | | | | | Checking if an uint32_t is less than zero is unnecessary, so we change the parameter and return value to int. Change-Id: I5c08eaf8fd4c33768a366b22f0f5db9575056a1e BUG: 789278 Signed-off-by: linbaiye <linbaiye@gmail.com> Reviewed-on: http://review.gluster.org/3965 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* dict: no need to memdup() the XDR buffer for dict_unserializeAmar Tumballi2012-10-011-7/+1
| | | | | | | | | | | | | * current memdup() of full buffer is not required as 'dict_unserialize()' does its own memdup() of the value. Change-Id: Iba866b68b753d060ee35bb300ee687e7d293ac82 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 850917 Reviewed-on: http://review.gluster.org/3845 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* Made test-ffop.c exhaustive by making it to test all types of fops.M S Vishwanath Bhat2012-10-011-7/+770
| | | | | | | | | Change-Id: I26052d0cbf72f81a6aa0c52498e99b635d1273e9 BUG: 861380 Signed-off-by: M S Vishwanath Bhat <vbhat@redhat.com> Reviewed-on: http://review.gluster.org/3931 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* write-behind: implement causal ordering and other cleanupAnand Avati2012-10-012-2418/+1070
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rules of causal ordering implemented: - If request A arrives after the acknowledgement (to the app, i.e, STACK_UNWIND) of another request B, then request B is said to have 'caused' request A. - (corollary) Two requests, which at any point of time, are unacknowledged simultaneously in the system can never 'cause' each other (wb_inode->gen is based on this) - If request A is caused by request B, AND request A's region has an overlap with request B's region, then then the fulfillment of request A is guaranteed to happen after the fulfillment of B. - FD of origin is not considered for the determination of causal ordering. - Append operation's region is considered the whole file. Other cleanup: - wb_file_t not required any more. - wb_local_t not required any more. - O_RDONLY fd's operations now go through the queue to make sure writes in the requested region get fulfilled before getting processed. - O_SYNC fd's operations now go through the queue to make sure previously acknowledged writes on the file (via other fds) are fulfilled before getting processed. - Option to not honor O_SYNC is now removed. - Option to ignore O_DIRECT is added (useful when running a VM and the drive appears with NCQ/TCQ or WCE=1 for the guest.) - Option to disable_first_nbytes is removed (as the cause of the bug which required this was diagnosed to be missing TCP_NODELAY.) - General cleanup and better conformance to coding style and convention. Change-Id: Ib44fb72da3727246b4a85174cb568c2f0231f6de BUG: 857673 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/3947 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* cluster/afr: Provide option to set readdir-size in entry-self-healPranith Kumar K2012-10-014-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Entry self-heal does lookups on all the entries that are read in readdir. More the size of readdir more number of lookups happen in parallel. It is observed that it leads to HUGE cpu spikes rendering everything else on the system unusable. Fix: Provided the option self-heal-readdir-size to configure the size. Default value is at 1KB. Tests: Checked that the readdirs are happening with the configured value in entry-self-heal. Change-Id: Icaa937ad88857e6f9a12375b1e7f6a49192bc8b1 BUG: 860895 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.org/4002 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* cli: removed extra dict unrefs and memory leaksKrutika Dhananjay2012-09-304-286/+200
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | PROBLEMS ADDRESSED: a. The following change http://review.gluster.com/#change,3948 introduces extra dict unrefs in cli. b. There are instances of memory leak in gf_cli_*_cbk functions. FIX: Problem (a) is fixed by ensuring the dict is ref'd (indirectly at the time of creation) and unref'd (in CLI_STACK_DESTROY) ONLY once. The following is the rationale behind this approach: The number of refs and unrefs on dict varies across the different commands that use it. The cli thread MUST wait for the gf_cli_*_cbks to complete before the frame is destroyed. This rules out the need to do extra refs and unrefs in the code path. Problem (b) is fixed by doing unref on dicts that are created for the purpose of unserializing the response but never freed in gf_cli_*_cbk functions. Change-Id: I5a7431543fc8e3cac4d256f5c87d1e3c62a331be BUG: 823081 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/3966 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* Fixed some general typing errors.Varun Shastry2012-09-275-8/+8
| | | | | | | | | | | | Eg: changed recieved to received Change-Id: I360fcb99c97c8a0222e373fee20ea2fccfb938db BUG: 860543 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/3998 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* mgmt/glusterd: Prevent extra unref in vol startPranith Kumar K2012-09-261-3/+4
| | | | | | | | | | | | | | | | | | | Problem: Volume start cli handler does dict_unref of the dict unconditionally. It needs to be unrefed only on failure. Fix: Unref the dict only on failure. Tests: Volume start works fine after the fix. Change-Id: I64e5ad3d48f69545dd5e1132672182732b98c466 BUG: 860833 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.org/4001 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* Fix parallel build issuesKacper Kowalik (Xarthisius)2012-09-262-0/+2
| | | | | | | | | | | | | Prevent creating symbolic links in not yet created sbindir. Since lex creates two files, make them depend on each other to prevent race condition. Change-Id: I72b633b24de33407006d70571b0a40adaa99dc2b BUG: 859843 Signed-off-by: Kacper Kowalik (Xarthisius) <xarthisius.kk@gmail.com> Reviewed-on: http://review.gluster.org/3968 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* build: Install glusterfs-logrotate as config fileVijay Bellur2012-09-252-2/+5
| | | | | | | | | Change-Id: I8255eb4249503eac0add87444da934256faffc01 BUG: 860037 Reviewed-on: http://review.gluster.org/3973 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* protocol/client: quick-reconnect after portmap queryAnand Avati2012-09-253-1/+11
| | | | | | | | | | | | | | | | | | Currently the disconnect after a portmap query is treated like an ordinary disconnect and the reconnection attempt (in this case, to the brick) is attempted only after 3 secs. This results in a delay which is unnecessary. Mark the disconnection happening because of a successful portmap query as needing a 'quick reconnect' to avoid the delay for this special case. Change-Id: I43c8292ff0c30858d883ff3569a3761acbf2f5eb BUG: 860220 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/3994 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* cluster/afr: Trigger heal on local subvols on any child_upPranith Kumar K2012-09-251-13/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The index in the child that comes online is generally empty because the changes would have happened on the other child which has been up. So the sync begins when the other child's poll time-out happens (i.e. 10 minutes). The expectation is that the sync must be triggered as soon as the connection with any brick is established. Fix: Whenever any child_up happens trigger the index self-heal on all local children in the replicate subvolume. Tests: 1) Checked that the self-heal is triggered on all local children whenever any child comes online. 2) Checked that the volume heal commands are working fine. Change-Id: I4f64737866470a2f989349a889ea52782930e11d BUG: 852741 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.org/3972 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* protocol/server: put the connection back if setvolume failsRaghavendra Bhat2012-09-251-1/+7
| | | | | | | | | | | | | | | | | In server_setvolume, put the connection back (thus removing it from a the list of connections that protocol/server is maintaining if the connection object is a newly created one) if some operations such as getting the bound_xl etc fails. Otherwise the process might segfault upon statedump, when it tries to access NULL bound_xl of a connection. Change-Id: Ifa340f534cd88d5601a9219da622b323fbe98b80 BUG: 858191 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/3953 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* gfapi: fix the failure in glfs_open()Amar Tumballi2012-09-251-1/+1
| | | | | | | | | | | | | * the issue is happening because the resolve_symlink() logic was reversed Change-Id: I10eca14d82e3ebf5a0195d5db1330f9e1a3e2dc4 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 839950 Reviewed-on: http://review.gluster.org/3978 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* cluster/afr: Wake up post-op on non-co-operative transactionPranith Kumar K2012-09-251-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The problem is observed when kernel untar is done. One file untar happens every second. The reason for this is, setattr lock is blocked on the prev fd data-transaction full-lock (because of eager-lock). Because of post-op-delay the post-op (xattrop + unlock) of the prev data-transaction happens after 1 sec. Until this the setattr is blocked resulting in performance problems in untar. Fix: Whenever an loc data, meta-data transaction comes, it should wakeup the prev-post-op on the same process' fd. Tests: The performance problem in untar went away. I put a breakpoint in client_finodelk for a 2G file dd and the inodelk is hit only 4 times. This confirms that the change does not affect post-op-delay in a -ve way. Change-Id: Ice3c2a1211f4dca6520a19bc4ba6cb9efb2902ad BUG: 845754 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.org/3975 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* geo-rep / gsyncd: gsyncd binary wrapper context fixesVenky Shankar2012-09-242-0/+25
| | | | | | | | | | | | | | | Changes to __gf_calloc (commit ed4b76ba) triggers a recursive sequence of _gf_log() and __glusterfs_this_location() calls. This is due to __gf_calloc() trying to access THIS which is not valid in the context of geo replication binary wrapper. This patch fixes the problem by introducing the relevant context in the wrapper. Change-Id: I32b0b6927074692dbf66bad2f3e93434201aaa82 BUG: 846569 Signed-off-by: Venky Shankar <vshankar@redhat.com> Reviewed-on: http://review.gluster.org/3859 Reviewed-by: Csaba Henk <csaba@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* core: enable process to return the appropriate error codeAnand Avati2012-09-214-13/+70
| | | | | | | | | | | | Setup a pipe() in glusterfs_ctx_t to communicate with the fork'ed child the exit status and return it to the shell. Change-Id: Ibbaa581d45acb24d5141e43ae848cae29312d95f BUG: 762935 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/3836 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* libglusterfs/graph: pass correct translator pairs during reconfigureRaghavendra G2012-09-212-8/+18
| | | | | | | | | | | | | | | | | when we autoload xlators like acl, worm or mac-compatibility, they will be loaded on top of old graph. However, corresponding ones won't be present in new graph, since newgraph doesn't contain autoloaded translators. While passing xlator pairs to reconfigure, this fact should be accounted and correct xlator pairs should be passed instead of blindly passing oldgraph->first and newgraph->first. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Change-Id: I8f4fe37b7e26dc2dcae78c1fe0d4a04f8ab84ed0 BUG: 857874 Reviewed-on: http://review.gluster.org/3949 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd: use runner_run_nowait() variant for starting bricksAnand Avati2012-09-201-2/+2
| | | | | | | | | | | | | This is a temporary change, which will be undone once glusterd is ready for handling portmap queries in a different thread while exec'ing brick processes. Change-Id: I389b9c38c7444e95fe9d8d0ff20fc91f4bfaf150 BUG: 762935 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/3963 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pranithk@gluster.com>
* runner: introduce a new variant runner_run_nowait()Anand Avati2012-09-202-0/+25
| | | | | | | | | | | | | which makes the child blindly _exit(0) (thereby relieving the caller quickly) and the grandchild continues to actually do execvp(). Change-Id: I4dac0f39aaaa5b2ae5dbeb96e221b8257f8d3a22 BUG: 762935 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/3962 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Csaba Henk <csaba@redhat.com>
* Prevent fuse from setting an invalid value of fd_ctxlinbaiye2012-09-201-2/+4
| | | | | | | | | | | This patch is used to prevent __fd_ctx_set() from setting an invalid value. Change-Id: I6756d83eab20fc485b3696ae341e21324f1c885c BUG: 789278 Signed-off-by: linbaiye <linbaiye@gmail.com> Reviewed-on: http://review.gluster.org/3961 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* glusterd: Fix to log command status at the appropriate timeKrutika Dhananjay2012-09-2014-537/+344
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PROBLEM: In the existing implementation, the success/failure of execution of a command is decided (and logged) in glusterd handler functions. Strictly speaking, the logging mechanism must take into account what course the command takes within the state machine before concluding whether it succeeded or failed. FIX: This patch attempts to fix the above issue for vol commands. The format of the log message is as follows: for failure: <command string> : FAILED : <cause of failure> for success: <command string> : SUCCESS APPROACH (in a nutshell): * The command string is packed into dict at cli and sent to glusterd. * glusterd logs the command status just before doing a "submit_reply", which is called (either directly or indirectly via a call to glusterd_op_cli_send_response) at 2 places for every vol command: i. in handler functions, and ii. in glusterd_op_txn_complete In short, the failure of a command in the handler implies the command has indeed failed. However, its success in the handler does NOT necessarily mean the command succeeded/will succeed. Change-Id: I5a8a2ddc318ef2dc2a9699f704a6bcd2f0ab0277 BUG: 823081 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/3948 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd: Fix compile time warning for gsyncd helper routineVenky Shankar2012-09-201-5/+8
| | | | | | | | | Change-Id: I262cc654a3d85ed690446b3875959565600b4bcd BUG: 846197 Signed-off-by: Venky Shankar <vshankar@redhat.com> Reviewed-on: http://review.gluster.org/3784 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Csaba Henk <csaba@redhat.com>
* rpcsvc: framework for executing actors as synctaskAnand Avati2012-09-193-1/+32
| | | | | | | | | | | | | | An rpcsvc_program can be registered by setting .synctask field to 1 which will make actors of that program be executed in a synctask, thus freeing up the rpc/poll thread while the actor executes. Change-Id: Idacef2ad3bcae0f354fd0fc16ca06ba7094d7b98 BUG: 762935 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/3833 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* performance/io-cache: provide hook for dumping inode contextRaghavendra Bhat2012-09-191-29/+38
| | | | | | | | | Change-Id: Idcf24200ad8f0cf018ab92118f6b77cc4b9edcab BUG: 843787 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/3816 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* fuse: override 'gid-timeout' option to disable aux gid compatibilityAmar Tumballi2012-09-191-0/+5
| | | | | | | | | | | | while mounting -o gid-timeout=-1 will be treated as disabling aux-gid Change-Id: I85c350868a8cc4a43f5e5aec9427222580da675b BUG: 835834 Signed-off-by: Amar Tumballi <amarts@redhat.com> Reviewed-on: http://review.gluster.org/3954 Reviewed-by: Brian Foster <bfoster@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* syncop: Implement access fopPranith Kumar K2012-09-192-0/+28
| | | | | | | | | Change-Id: I959144451790d7e47ae48564923d324451a9db23 BUG: 858602 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.org/3958 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* mount/fuse: readdir() should return 32-bit inodes when 'enable-ino32' is usedNiels de Vos2012-09-183-5/+19
| | | | | | | | | | | | | | | | | | | | The glusterfs mount option 'enable-ino32' does not change the behaviour of readdir(). fuse_readdir_cbk() uses entry->d_ino directly, and this was missed in commit c13823bd16b26bc471d3efb15f63b76fbfdf0309. By adding the function gf_fuse_fill_dirent(), the fuse_dirent structure is filled in a similar way as the fuse_attr structure. This helper uses the same function to squash the 64-bit inode in a 32-bit attribute. Change-Id: Ia20e7144613124a58691e7935cb793b6256aef79 BUG: 850352 URL: http://lists.nongnu.org/archive/html/gluster-devel/2012-09/msg00051.html Tested-by: Steve Bakke <sbakke@netzyn.com> Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/3955 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* dual licenseKaleb S. KEITHLEY2012-09-181-6/+6
| | | | | | | | | | | rebased BUG: 820551 Change-Id: I9c51d68e52a9252c5a43af1677380a410ca69519 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/3856 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* cli/: Filter out the loopback address for brick creation.Varun Shastry2012-09-181-2/+4
| | | | | | | | | | | | Don't create the volumes with brick address 0.0.0.0 to 0.255.255.255 (http://en.wikipedia.org/wiki/Reserved_IP_addresses) Change-Id: Ic5464ec370bddf498a5220acf2d367b877e21e66 BUG: 787627 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/3865 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* logging: log ENOENT errors in DEBUG mode instead of ERROR or INFORaghavendra Bhat2012-09-172-2/+4
| | | | | | | | | | Change-Id: I0a43769223991e4ad5206b4382d737a0c3557bf3 BUG: 851953 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/3934 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/marker: if parent inode is NULL, then get it by inode_parentRaghavendra Bhat2012-09-172-4/+13
| | | | | | | | | | | | | | | | | | | * If parent inode is NULL (nameless lookups which uses gfid for looking up the inode), then try to get it by inode_parent, instead of returning which results in the inode's contribution not being added to the list. * Prevent exceesive logging while adding the inode's contribution to the list if the operation fails. (Check if the inode's gfid is null which indicates that the inode is not yet linked to the inode table and hence addition of its contribution to the list can fail). Change-Id: I5300f00195ae92a5122613898ae3dabddb2d0bfe BUG: 851953 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/3935 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* CLI: Displaying time as N/A when unix time is 0Varun Shastry2012-09-172-5/+6
| | | | | | | | | | | | | | | | | | | Problem: 'volume top open' command was displaying '1970-01-01 00:00:00.000000' when no file has opened yet. Fix: Made the fix in gf_time_fmt() to make it more generic according to patchset 1 review comment. Change-Id: I748ed203bd0d9fbaac94b5b51ed708b34fccd434 BUG: 852000 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/3924 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Clean up of typepunning errors ( Strict aliasing warnings )Varun Shastry2012-09-173-33/+29
| | | | | | | | | | | Change-Id: I48733967facc526fb523a8dc9bd068f8c5cc5971 BUG: 764282 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/3950 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd: Fix remote processes not being shown in "volume status"Kaushal M2012-09-171-3/+4
| | | | | | | | | | | | Also, refactor function name so it makes more sense. Change-Id: I3bd3e1bdcacb522ddf4f39d09f73be1c53915362 BUG: 856480 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.org/3933 Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* protocol/server: dump the ltable and fd table related inodes onlyRaghavendra Bhat2012-09-174-29/+98
| | | | | | | | | | | | | Do not dump the entire inode table in the statedump. Instead dump those inodes only which are present in fdtable or ltable. Change-Id: If848f9a6198927b4cc0abd47339461f3ea41d6df BUG: 844688 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/3848 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* features/quota: Avoid mem_put on null localPranith Kumar K2012-09-172-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Problem: QUOTA_STACK_UNWIND does not check if local is NULL before mem_put. This leads to a callingfn log for every setxattr in quota. Fix: Made sure the mem_put happens only on non-null local in quota. Additional changes: Removed unused QUOTA_STACK_DESTROY macro. Tests: Peformed setfattr on the mount point and the Invalid argument logs don't come anymore. Checked that the change does not introduce any memory leak in quota. Change-Id: Ie4534c7af0fff80e35d8510311055f930262594f BUG: 856541 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.org/3936 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* gfapi: add symlink (auto resolution) support in resolverAnand Avati2012-09-173-4/+96
| | | | | | | | | | | | - new internal API glfs_lresolve() for usage with APIs like glfs_lXXXX() (e.g. glfs_lstat()) Change-Id: I61c60af6bda3072f189684ad8ac9815d59f455fc BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/3866 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* mount/fuse: treat NULL gfid is a failure in lookup disregarding op_retAnand Avati2012-09-171-2/+14
| | | | | | | | | | | | | | | | | | | It is not possible to inode_link() with a NULL gfid. If a lookup (or any other "entry" op) returns a success but has a NULL gfid, then treat it as a failure even if op_ret was 0. Currently AFR does this when self-healing fails/aborts in certain situations (like entrylk acquisition failure, gfid mismatch etc.) returning a NULL gfid in struct iatt of lookup_cbk with op_ret = 0. Fixing this is an independent patch and fuse-bridge needs to be robust against such misformed replies in any case. Change-Id: If5f75780c0b5b1303f466711f1992f90a77e768a BUG: 856921 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/3952 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Brian Foster <bfoster@redhat.com>
* cli: Fix double free in cli_add_key_groupKrishnan Parthasarathi2012-09-141-0/+2
| | | | | | | | | Change-Id: I3c2f030ac7c53913612a3fbac5e582c47b005621 BUG: 851237 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/3943 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* storage/posix: Option to set brick(of a volume)'s root dir's uid/gidKrishnan Parthasarathi2012-09-142-6/+46
| | | | | | | | | | | | | | | | | | CLI --- gluster volume set VOLNAME owner-uid uid gluster volume set VOLNAME owner-gid gid where uid,gid are the owner's user id and group id respectively that would be set on the root of all brick (backend) fs. TODO: uid/gid should not be -1. Today we don't validate that in CLI. Change-Id: Ib6a2fb5e404691c5fe105a89faaeff3e1ab72e91 BUG: 853842 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/3891 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd: Fixed _is_prefix check for two file pathsKrishnan Parthasarathi2012-09-131-4/+25
| | | | | | | | | | Change-Id: Iad1f7c865c4ce5092d85379257ba7a5ec95f7ebc BUG: 764890 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/3937 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* All: License message changeVarun Shastry2012-09-13160-1053/+923
| | | | | | | | | | | | License message changed for server-side, dual license GPLV2 and LGPLv3+. Change-Id: Ia9e53061b9d2df3b3ef3bc9778dceff77db46a09 BUG: 852318 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/3940 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterfs SEGV on Fedora 17 from UFO fallocate(2) callKaleb S. KEITHLEY2012-09-131-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An upload of a file will cause the volume's glusterfs to SEGV when it fields a FUSE_FALLOCATE op. Swift inspects libc to determine if there is a symbol for fallocate(2) and if so will use it. And while the libc in RHEL 6 does have fallocate(2), the version of fuse in RHEL 6 does not support fallocate, and things are handled gracefully elsewhere (the kernel perhaps?) N.B. fallocate was added to version 7.19 of fuse. Fedora 17 and later (and maybe earlier too) has 7.19. RHEL 6 still has 7.13. Glusterfs uses the 7.13 version <linux/fuse.h> (in contrib/fuse-include/fuse_kernel.h) Thus on Fedora 17, with both fallocate(2) in libc and fallocate support in fuse, the fallocate invocation is dispatched to glusterfs, but the dispatch table (fuse_std_ops in xlators/mount/fuse/src/fuse-bridge.c) is too short for one thing; the fallocate opcode (43) indexes beyond the end of the table, and even when that doesn't directly cause a SEGV, the NULL pointer at that location does cause a SEGV when attempting to call the function through the pointer. BUG: 856704 Change-Id: I148acbf1265f01a15bd158f227c8a7cb9365606e Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/3938 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* fuse-bridge: Pass unknown option down to fuseLubomir Rintel2012-09-126-4/+44
| | | | | | | | | | | | | | | | | | In Linux, certain "filesystem-specific" options (passed in string form in last argument to mount(2)), such as "rootcontext" or "context" are in fact common to all filesystems, including fuse. We should pass them down to the actual mount(2) call untouched. This is achieved by adding "fuse-mountopts" option to mount/fuse translator and adjusting the mount helper to propagate it with unrecognized options as they are encountered. BUG: 852754 Change-Id: I309203090c02025334561be235864d8d04e4159b Signed-off-by: Lubomir Rintel <lubo.rintel@gooddata.com> Reviewed-on: http://review.gluster.org/3871 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* dht: improve dht_fix_layout_of_directory for better re-assignmentAnand Avati2012-09-121-145/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Jeff Darcy wrote: > AFAICT, the fix-layout code doesn't do the same rotation that the > new-directory code does. Therefore, the new bricks always claim > completely predictable hash ranges for every directory, leading to > either a 0-1-2-3 pattern or a 1-0-2-3 pattern. In other words, a > file whose hash falls into the second quarter of the range will always > be assigned to brick 2, and a file whose hash falls into the fourth > quarter will always be assigned to brick 3. The rest will be split > according to the original pattern. Put still another way, instead of > same-named files in different directories being spread across N bricks, > they might be spread across only two bricks (bad) or totally > concentrated on one brick (worse) regardless of N. The current dht_fix_layout_of_directory() code, in an attempt to maximize overlap of new layout with existing layout (to minimize movement of data) fails to do a good job of randomizing new assignment even when it could do a better job. In an example where we expand from 2 nodes to 4 nodes, the current possibilities are limited in the following way - (theoretical hash range: 00 - 99) OLD 1 ----- server1: 00 - 49 server2: 50 - 99 NEW 1 ----- server1: 00 - 24 server2: 50 - 74 server3: 25 - 49 server4: 75 - 99 OLD 2 ----- server1: 50 - 99 server2: 00 - 49 NEW 2 ------ server1: 50 - 74 server2: 00 - 24 server3: 25 - 49 server4: 75 - 99 The above shows that when add-brick from 2 bricks to 4 bricks, server3 and server4 always get the _same_ hash range no matter what the original hash range assignment was. The fix in this patch is first do the standard new directory assignment to a directory (with rotation etc.) and then do the reassignment to maximize overlap. This way newly added servers still get random ranges and existing servers have a probability of getting either of the quarters which were part of its half previously. The same principles hold for all add-brick from M to M+N. Change-Id: I0cbbf3bfa334645728072d66aaaa80120d0b295f BUG: 853258 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/3883 Tested-by: Gluster Build System <jenkins@build.gluster.com>
* event: peel out poll and epoll specific code into separate filesAnand Avati2012-09-124-836/+920
| | | | | | | | | | | code re-org, no change in logic. Change-Id: Ib1cb3d3f4cf8989a916df7476479c26570d07a84 BUG: 821087 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/3932 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>