529 Commits

Author SHA1 Message Date
Harshavardhana Ranganath
c5b90f7595 Appropriate changes to statvfs struct for Solaris host.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-19 21:04:02 +05:30
Shehjar Tikoo
35fc174ea3 libglusterfsclient: Comply with EEXIST rule on rename
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>
2009-05-18 19:13:18 +05:30
Shehjar Tikoo
95ce0a87f5 libglusterfsclient: __do_path_resolve: Fix pathname resolution bug
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>
2009-05-18 19:13:12 +05:30
Shehjar Tikoo
fe06790a36 libglusterfsclient: Wipe loc->ino in libgf_client_loc_wipe
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>
2009-05-18 19:13:08 +05:30
Shehjar Tikoo
1279d7398c booster: Add telldir API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-18 19:13:05 +05:30
Shehjar Tikoo
e3e7f850ed booster: Add seekdir API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-18 19:13:00 +05:30
Shehjar Tikoo
358f5ba408 booster: Add rewinddir API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-18 19:12:56 +05:30
Shehjar Tikoo
e420eb2206 libglusterfsclient: Refine readdir entry parsing logic
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>
2009-05-18 19:12:52 +05:30
Shehjar Tikoo
e1ae573f73 libglusterfsclient: Add telldir API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-18 19:12:49 +05:30
Shehjar Tikoo
35bf3f0584 libglusterfsclient: Add seekdir API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-18 19:12:45 +05:30
Shehjar Tikoo
dddcf49861 libglusterfsclient: Add rewinddir API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-18 19:12:41 +05:30
Shehjar Tikoo
aeda0a3197 libglusterfsclient: Revert and re-do readdir conformance
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>
2009-05-18 19:12:37 +05:30
Shehjar Tikoo
4f1a87a245 booster: Supplement fstab option parsing
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>
2009-05-18 19:12:27 +05:30
Anand V. Avati
a5301c874f workaround for not including sys/cdefs.h -- including sys/cdefs.h breaks build on solaris and other platforms 2009-05-18 17:24:39 +05:30
Vikas Gorur
0346e3e889 Bug fix in pl_readv/writev to handle the mandatory lock case properly.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-18 17:10:48 +05:30
Raghavendra G
49523c834f client-protocol: Fix memory corruption in client_lookup
- 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>
2009-05-16 16:40:32 +05:30
Raghavendra G
254f770af6 dict.c: make dict_serialized_length and dict_serialize to hold locks.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-16 16:40:26 +05:30
Raghavendra G
9669c70c90 dict.c: Add dict_allocate_and_serialize
- this procedure atomically allocates a buffer and serializes dict into it.
  - this procedure helps avoid memory corruptions due to race conditions where
    in new members are added into dict between allocating a buffer for
    serializing and actually serializing buffer into it.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-16 16:40:18 +05:30
Csaba Henk
dec2674685 make getxattr fail with ERANGE if reply is bigger than what was requested
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>
2009-05-16 16:36:18 +05:30
Raghavendra G
b4651c4b8c apache/2.2/mod_glusterfs: port to use new glusterfs_readdir interface.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-16 15:34:01 +05:30
Amar Tumballi
43a568d732 avoid duplicate mounts while using mount.glusterfs
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>
2009-05-16 15:33:46 +05:30
Harshavardhana
ce653eadc2 modified init scripts to honour @prefix@
fixes http://savannah.nongnu.org/bugs/?26581

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-16 15:32:44 +05:30
Vikas Gorur
11cae446e0 Edited log message for --volfile-check
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-16 15:31:52 +05:30
Amar Tumballi
19a1ce8942 minor log enhancement in 'ib-verbs' transport.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-16 15:31:33 +05:30
Amar Tumballi
92a84f8c0f replace BIG_FUSE_CHANNEL_SIZE with 'this->ctx->page_size'
Send the struct stat's  'blksize' variable same as GlusterFS's page-size,
instead of BIG_FUSE_CHANNEL_SIZE.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-16 15:28:09 +05:30
Amar Tumballi
4f7552c23b default log file different per mount (or if server, per volumefile)
This feature is required becuase when more than one glusterfs process
is started with default log file, all logs will be going to same file,
which after a while gets more confusing.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-16 15:28:09 +05:30
Shehjar Tikoo
f4fbc7200c posix: Fix build warning on incorrect type
This fixes a build warning due to use of incorrect
type for size_t, for Core 2 Duo.

Extra fix from avati: change %ld to GF_PRI_SIZET

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-16 15:27:38 +05:30
Amar Tumballi
5c1d9108c1 stripe init 'block-size' pattern parsing bug fixed.
ref: http://savannah.nongnu.org/bugs/?26416

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-08 18:16:01 +05:30
Raghavendra G
20e8fc7a61 scheduler-nufa: fix initialization of refresh-interval
- refresh-interval was being reported as not provided in the options
    even when configured.
  - fixes bug reported in rt #1007

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-08 18:15:40 +05:30
Vikas Gorur
124f02ed49 Set op_errno properly in afr_flush.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-08 18:12:16 +05:30
Shehjar Tikoo
b3f7efe247 booster: Add fstab parsing support
This commit changes the booster.conf format from a
simple custom format to that of the /etc/fstab.c

See booster_mount(..) for the mount options supported/required
for LD_PRELOADing booster. I'll write a small help doc soon.

This commit also brings in fstab parsing code into libglusterfs
because Darwin libc only supports reading the hardcoded /etc/fstab.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-08 18:11:53 +05:30
Shehjar Tikoo
5f4c102297 booster: Standardize conf file and env variable
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-08 18:10:31 +05:30
Anand V. Avati
adb56cb5e0 backend-xattr-sanitize.sh: script added to extras/
Run the script as:

sh$ ./backend-xattr-sanitize.sh /data/export0

and it will remove all the known stale xattrs on the backend files and dirs
2009-05-07 15:12:09 +05:30
Anand V. Avati
babc4dfb08 valid_host_name(): accept string lengths upto 75 chars (the limit accepted by glibc resolver) 2009-05-07 13:28:21 +05:30
Raghavendra G
fd2e7d9ebb symlink-cache: fix return value of readlink
- sc_readlink wrongly returned strlen (link) + 1 when link was present in
    cache.
  - this fixes rt #828. Since fuse_readlink_cbk does link[op_ret] = '\0', there
    was a memory corruption.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-07 12:52:45 +05:30
Amar Tumballi
542d9ed6c1 fix in mount.glusterfs for proper direct io mode option.
fixes the bug which causes GlusterFS not to have valid 'direct-io'
option through mount command or /etc/fstab entries.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-07 12:52:33 +05:30
Anand V. Avati
92a84a43e0 protocol/client: indentation fixes 2009-05-07 11:59:23 +05:30
Anand V. Avati
2ff188571e protocol/client: removed conf->child 2009-05-07 11:06:34 +05:30
Anand V. Avati
f9f5519b66 transport shortcut b/w client and server
This patch makes the server pass back the transport pointer of the client. If the UUID matches, the client makes the local transport 'shortcut' with the remote transport (pointer received from server)

The shortcut simulates a socket queue. Instead of serialized messages going over the network and getting queued in the tcp socket queue, the messages get queued in a transport specific queue picked by a polling thread.
2009-05-07 01:24:41 +05:30
Anand V. Avati
12eb832e25 fix log message from transport-timeout to frame-timeout 2009-05-06 14:40:45 +05:30
Shehjar Tikoo
cba961e9f4 libglusterfsclient: Improve readdir conformance on re-entrancy
readdir is supposed to be non-re-entrant only with respect to the
given dir stream, not the whole process.

What that means is the static struct dirent that we maintain in
libglusterfsclient should be per-directory handle and not
process-wide.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-06 12:37:19 +05:30
Shehjar Tikoo
f82651ef4f libglusterfsclient: Fix large directory reading bug
As of now, we use 1024 bytes as the buffer for reading directory
entries. If a directory as many files, then its possible that it does
not fit into this buffer, thereby requiring more than one call to
readdir. Now suppose the last bunch of directories fit more or less
exactly int the 1024 byte buffer. If this happens, the offset
extracted by the current logic(in libgf_client_readdir) never gets
updated beyond the first entry in this last block, because the last
block's first entry always remains same. This explanation is
convoluted, I know, but I too found out the hard way.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-06 12:36:35 +05:30
Shehjar Tikoo
8d1b62393b booster: Use CONFDIR as booster.conf default location
This commit changes the default location of the booster.conf
file from /etc/booster.conf to a directory defined
during the build process.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-06 12:36:19 +05:30
Shehjar Tikoo
faef6fded8 booster: Change booster conf env var name
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-06 12:32:08 +05:30
Anand V. Avati
f6862d75d1 afr self-heal: update file size of the returning stat buf with source file's size 2009-05-06 11:43:33 +05:30
Anand V. Avati
3f3dea5f23 log level fixes in read-ahead 2009-05-05 20:10:44 +05:30
Anand V. Avati
9cb93f58be log level fix in storage/posix 2009-05-05 20:10:44 +05:30
Anand V. Avati
f62628af61 io-cache logging level fixes 2009-05-05 20:10:38 +05:30
Shehjar Tikoo
e9800f8915 libglusterfsclient: Add 0-byte size/count guards
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-05 17:51:24 +05:30
Shehjar Tikoo
fe94d6e499 booster: Add lchown API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-05-05 17:51:16 +05:30