721 Commits

Author SHA1 Message Date
Vijay Bellur
dcfc4bdd59 Changed prototype for inode_table_dump() and inode_dump().
Changed prototype for inode_table_dump() and inode_dump()
Added support for dumpop inode in mount/fuse and protocol/server

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 213 (Support for process state dump)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=213
2009-09-16 07:11:33 -07:00
Vijay Bellur
fd9c608193 libglusterfs:Acquire lock before accessing fdtable contents during statedump.
Hold lock while dumping fdtable.
Dump only inode ino instead of the complete inode.

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 213 (Support for process state dump)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=213
2009-09-16 07:11:19 -07:00
Raghavendra G
b0d3d94b8c common-utils: introduce new macro GF_VALIDATE_OR_GOTO_WITH_ERROR
- the existing macro GF_VALIDATE_OR_GOTO sets errno to EINVAL
    which may not be appropriate in all cases.

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 221 (stat prefetch implementation)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=221
2009-09-08 01:41:15 -07:00
Shehjar Tikoo
c50ead8d53 core: Fix build failure on non-Linux systems
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 230 (Bulid fails on Solaris and Mac OS due to Linux specific flags)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=230
2009-09-02 10:30:00 -07:00
Vijay Bellur
b4d6c3d1bb TAKE2[PATCH BUG:213 1/1] Support for Process State Dump
Support for process state dump.

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 213 (Support for process state dump)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=213
2009-08-19 17:57:53 -07:00
smyczek
ed80e78aec libglusterfs: fix SuperFastHash function used in dicitionaries in fact it always returned the value of second parameter (len) as a result.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 155 (The SuperFastHash function used in dictionaries is broken.)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=155
2009-07-27 11:33:42 -07:00
Shehjar Tikoo
03d6dae5a4 libglusterfsclient: Fake a fsid for every VMP
This is needed to work around the replicate behaviour of
possibly returning device number for the same file from

different subvolumes.

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 148 (replicate: Returns st_dev from different subvols resulting in ESTALE thru unfs3booster)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=148
2009-07-20 14:29:30 -07:00
Amar Tumballi
1a56bed501 added timestamp to crash dump log.
also did some minor enhancements in formating

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 151 (crash dump log should be in 'logviewer' friendly format)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=151
2009-07-20 14:29:23 -07:00
Amar Tumballi
632cce5e72 fix build warnings in 'libglusterfs/'
return value of 'asprintf' was not checked, and the flow was
continuing without returning error, which could cause potential
segfaults in code (mostly possible during ENOMEM case).

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 130 (build warnings)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=130
2009-07-20 14:28:53 -07:00
Amar Tumballi
3ce764351c add strict validatation of GF_OPTION_TYPE_PATH option type.
Make sure that users don't provide "../" in the path value in volume file,
which should be considered security issue.

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 141 (GF_OPTION_TYPE_PATH should check for presence of ".." in path)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=141
2009-07-16 00:37:33 -07:00
Amar Tumballi
f2ba42e4c6 break inode_path if the length of the path crosses PATH_MAX
a given search for path can't exceed the length of PATH_MAX in any case.
Hence, its best to make sure by adding a check inside the for loop of
inode_path, so that it won't enter an infinite loop.

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 134 (infinite loop in inode_path ())
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=134
2009-07-16 00:37:27 -07:00
Amar Tumballi
106f0e848a cleanup 'ctx' from inode and fd
Removing unused 'dict_t *ctx' from both inode and fd structures.

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 128 (cleanup unwanted ctx dictionary in 'inode' and 'fd' structures.)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=128
2009-07-16 00:37:23 -07:00
Anand Avati
9ec22fd9fc protocol: add functions gf_flags_from_flags and gf_flags_to_flags
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-07-07 19:32:17 -07:00
Basavanagowda Kanur
41027a2205 libglusterfs/defaults - send CHILD_UP notify only to the parent which has been init()ed.
fixes bz# 12

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-07-06 21:32:43 -07:00
Basavanagowda Kanur
8d74fe9ba6 libglusterfs/logging - fix memory leak
in _gf_log(), free 'msg' before returning.

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-07-06 19:24:32 -07:00
Basavanagowda Kanur
fd70ec7646 libglusterfs - remove definition of ZR_FILENAME_MAX
to maintain uniformity of maximum length of file name, through out
glusterfs, use NAME_MAX.

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-07-06 12:37:08 -07:00
Basavanagowda Kanur
6abd0c4926 libglusterfs/call-stub - replace ZR_FILENAME_MAX by NAME_MAX
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-07-06 12:37:06 -07:00
Shehjar Tikoo
7261ef381a mem-pool: Do not perform chunkhead2ptr on MALLOCed memory
Memory allocated from the heap instead of the mem-pool
need not under go the chunkhead to ptr conversion when returning
to a mem-pool user since this address can be use directly.

This fixes a crash in io-threads.

Ref: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=102

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-07-06 12:37:05 -07:00
Vikas Gorur
52d0ae7bc3 Print volume file after printing other details.
This makes the log format compatible with earlier
versions. Fixes bug #105.

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-07-02 10:14:47 -07:00
Amar Tumballi
193b0e696f version changes in GIT repo to differentiate between branches
package-version: because master is undergoing changes for 2.1.x release,
protocol-version: because of addition of mops 'log'

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-06-30 16:10:34 -07:00
Shehjar Tikoo
f5ec3b6a95 libglusterfs-fd: Simplify gf_roundup_power_of_two
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-06-29 10:42:06 -07:00
Shehjar Tikoo
e3e8801801 booster: Remove gf_fd_unused_get2
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-06-29 10:42:05 -07:00
Amar Tumballi
66224718ab version check between client/server made more specific to protocol only.
This patch is a step towards giving compatibility between the versions of
GlusterFS. Now onwards, the protocol-version won't depend on release
versions. In general, multiple glusterfs versions can have common
protocol-version.

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-06-29 09:59:12 -07:00
Anand V. Avati
c4cf372fbc gf-dirent: add support for stat attribute in dir entry (to work like
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-06-26 11:09:19 -07:00
Vikas Gorur
93c8ce0e3f Add command line option to specify central log server.
Added two command line options:

--log-server SERVER
--log-server-port PORT

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-06-18 15:54:13 -07:00
Amar Tumballi
d3e1a3d453 adding an extra xlator option type, GF_OPTION_PERCENT_OR_SIZET.
Originally from Paul Rawson <plrca2@gmail.com>

http://patches.gluster.com/patch/391/ : patch re-submitted with patching guidelines.

with this patch, the xlator volume options get another type which can take
arguments either in 'percent' or in 'bytes', which is useful in many cases.

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-06-18 13:08:04 -07:00
Shehjar Tikoo
bb451c37bc libglusterfs: Prevent gf_fd_put'ing of unallocated fd
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-06-18 13:08:04 -07:00
Shehjar Tikoo
617de1c718 libglusterfs: Chain newly allocated fdentries.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-06-18 13:08:04 -07:00
Shehjar Tikoo
804e34cc49 libglusterfs: Change GF_FDENTRY_ALLOCATED constant
This change is being brought in so that we can

differentiate between fdentry_ts when debugging using
gdb.

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-06-18 13:08:03 -07:00
Vijay Bellur
7437305962 Removed the swap being done for __noswap functions.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-06-17 16:04:33 -07:00
Shehjar Tikoo
efcce99096 libglusterfs: Turn fd-table O(1)
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>
2009-06-15 23:44:36 -07:00
Raghavendra G
4eac667d30 write-behind: check for memory allocation failures and take appropriate action
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-06-15 23:44:35 -07:00
Vikas Gorur
2943c77d88 Log to a central server.
Several functions to support centralized logging:

 - create a logging thread upon init
 - gf_log submits log messages to the logging thread which
   in turn sends it to the server using the MOP log

 - on the server side, log messages from a client are written
   to the filename <log file name>.client-<transport-identifier>

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-06-11 07:51:27 -07:00
Vikas Gorur
e7e6144a76 Functions to store a central log flag in TLS.
The flag is set in TLS so that a re-entry into
gf_central_log does not deadlock.

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-06-11 07:51:27 -07:00
Vikas Gorur
f7ca417394 Include glusterfs.h in dict.c
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-06-11 07:51:26 -07:00
Vikas Gorur
1a69896139 Added MOP log to libglusterfs/*
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-06-11 07:51:26 -07:00
Shehjar Tikoo
4c0b91a5a0 libglusterfs: Add empty and NULL dirents list checks
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>
2009-06-08 06:31:55 -07:00
Anand V. Avati
abb075def5 THIS: use xlator_init() for initializing xlators
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-05-22 01:26:20 -07:00
Anand V. Avati
6d5aff7bfd THIS: add xlator_init() API to set @THIS
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-05-22 01:23:48 -07:00
Anand V. Avati
61e343c72b THIS: default_notify to use xlator_notify for THIS compatibility
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-05-22 01:08:42 -07:00
Anand V. Avati
9cec4a0a79 THIS: xlator_notify API to be used for propagating notifications with proper THIS setting
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-05-22 01:06:11 -07:00
Anand V. Avati
99bf8da476 THIS: set appropriately in call stub resumes
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-05-22 01:03:41 -07:00
Anand V. Avati
b7c1bcb4ea THIS: set appropriately in STACK_* macros
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-05-22 01:01:11 -07:00
Anand V. Avati
207fb347ed globals: add globals.h/c THIS: macro to access thread specific current xlator CTX: macro to access glusterfs global context (glusterfs_ctx_t)
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-05-22 00:58:42 -07:00
Shehjar Tikoo
c7fd9f1df3 mem-pool,io-threads: Destroy mem-pool on deallocation
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
2009-05-21 02:58:22 -07:00
Shehjar Tikoo
ef7fcc0d7c booster: Move fstab parsing into booster from libglusterfs
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>
2009-05-20 22:47:17 -07:00
Shehjar Tikoo
a9d0be4f1b mem-pool: Restructure mem-pool behaviour
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>
2009-05-19 21:13:22 +05:30
Shehjar Tikoo
25dc191c51 mem-pool: Fix #define spelling
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-19 21:13:22 +05:30
Shehjar Tikoo
3aea8a66a4 mem-pool: Remove hard coded value for pad boundary
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-19 21:13:22 +05:30
Shehjar Tikoo
acf28ed1ef mem-pool: Fix memory leak in mem-pool init phase
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-19 21:13:22 +05:30