241 Commits

Author SHA1 Message Date
Kaushal M
fc481386d2 glusterfsd: Make sure mountpoint is an absolute path
If the mountpoint path given to glusterfs is not an absolute path, convert it to
an absolute path by concatenating it with the curren working directory.
This prevents cases, where in gluster cannot perform clean unmounts when mount
is done with a relative path.

Change-Id: Ie25add4e1dc59171e522c4244c79a6c148844ab3
BUG: 819466
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/3302
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-05-08 17:00:21 -07:00
Raghavendra G
27fb213be6 fuse-resolve: consider cases where an entry should be resolved even
when parent belongs to active itable.

When parent is root, the parent inode returned will always be
active_subvol->itable->root and hence there can be cases where we
should explicitly resolve the entry in active graph.

Change-Id: I4e82df9a351ff6b5304891abc9932495bf7ea79d
BUG: 804592
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/3007
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-05-08 15:34:53 -07:00
Pranith Kumar K
11a19ce031 Resolve: Assign correct path while resolving
Change-Id: Ia17ff38a60225dd2e9115aaa298bed42f9e43f56
BUG: 812277
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/3248
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-05-08 13:39:01 -07:00
Kaushal M
3651c7425e mount.glusterfs: Fix log-level
Change-Id: Ia5ad073ba384e1569970ada8763a8bf9bccbc9c4
BUG: 818835
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/3272
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
2012-05-04 23:41:28 -07:00
Raghavendra Bhat
2a59514236 mount/fuse: unref the fds after they have been migrated to the new graph
In fuse upon graph changes fds were being migrated to the new graph.
It was done by taking all the fds from the fdtable in a structure and then
migrating each fd in the structure to the new graph. But after the fds
are migrated the structure which had the fds within it (that is refed fds)
was being freed without unrefing the fds, thus leading to a fd leak.

Change-Id: I7b25220a48954384a004373d378cee11c6109f7e
BUG: 811552
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-on: http://review.gluster.com/3222
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-04-24 13:08:24 -07:00
Emmanuel Dreyfus
7313b22f10 NetBSD build fixes
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>

Change-Id: I8f9aabeadd2f842521a82e59594115bd80155d68
BUG: 2923
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.com/3053
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-04-23 21:29:03 -07:00
Amar Tumballi
29f2de478c core: coverity issues fixed
this is not a complete set of issues getting fixed. Will
address other issues in another patch.

Change-Id: Ib01c7b11b205078cc4d0b3f11610751e32d14b69
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 789278
Reviewed-on: http://review.gluster.com/3145
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
2012-04-23 14:52:57 -07:00
Csaba Henk
664daecef4 clean up handling of special client pids
- no need to name a lower boundary [drop GF_CLIENT_PID_MIN]
- drop utility function to decide about pid speciality [gf_pid_client_check()];
  when we implement uniform policy for special pids, use just comparison with
  GF_CLIENT_PID_MAX (currently such uniform policy exists in io-threads, where
  special clients get lowest priority)
- io-threads: drop numeric literal, use GF_CLIENT_PID_MAX
- xattr flipping (in fuse):
  - fuse_xattr_alloc_default() made static
  - avoid compiler warnings wrt. partial enum traversal in the switch
    by not casting the original numeric value to gf_client_pid_t (enum) type
  - trim down the switch to those cases with which there is something to do
    [GF_CLIENT_PID_GSYNCD, GF_CLIENT_PID_HADOOP]
  - eliminate the (theoretical) chance of succesfully returning
    from fuse_flip_xattr_ns() with unallocated nkey
    [as was the case with pids GF_CLIENT_PID_{MIN,MAX,DEFRAG}]

Change-Id: Ic2b83b908d8e3be23a7fba1e5895869828a6194b
BUG: 765433
Signed-off-by: Csaba Henk <csaba@redhat.com>
Reviewed-on: http://review.gluster.com/3170
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-04-23 14:50:55 -07:00
Jeff Darcy
7d0397c214 fuse: allow requests during mount (needed for SELinux labels)
Change-Id: Ia1af402897e6a7290acf79617c34fdc804751729
BUG: 811217
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.com/3199
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-04-23 14:37:24 -07:00
shishir gowda
42c06ba048 glusterd/rebalance: Start process with xlator option client-pid -3
This would prevent updation of xtime by the marker.

Signed-off-by: shishir gowda <shishirng@gluster.com>
Change-Id: I11e287511026326271c2926e55993e48b32018f6
BUG: 812287
Reviewed-on: http://review.gluster.com/3144
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Mohammed Junaid <junaid@redhat.com>
Reviewed-by: Csaba Henk <csaba@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-04-16 11:21:50 -07:00
Jeff Darcy
d2a73be6d9 mount.glusterfs: multiple fixes
* noticed that the regex to parse the options were not fool proof.
  for example, 'ro' in a logfilename could have made the mount
  point read-only. Now fixed.

* this issue existed for 'acl', 'worm' options.

* log-server/log-server-port options were legacy, and no more
  needed in codebase.

* refactored option processing in general to avoid above issues

Change-Id: I172d24c86ece9a34420ba997fa385e304b4924ae
BUG: 806978
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.com/3058
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-04-13 00:20:04 -07:00
Anand Avati
f56404a335 fuse-bridge: generate GFID as gfid-req in fresh lookup
This is necessary for self-heal to assign fresh GFID when
performing lookup on files/dirs without GFID (migration from
old version, etc.)

Change-Id: I6f070255dc6e85bf6625b704cb5fb7f831ee58e6
BUG: 795355
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.com/3101
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pranithk@gluster.com>
2012-04-11 09:55:03 -07:00
Raghavendra G
1f3a0dd474 fuse-bridge/fd-migration: document migration failures in fdctx.
Change-Id: Ib85871e586f89f88dd7bf738fbb284b5d7b70a86
BUG: 809919
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/3085
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-04-04 16:27:45 -07:00
Amar Tumballi
9d3af972f5 core: adding extra data for fops
with this change, the xlator APIs will have a dictionary as extra
argument, which is passed between all the layers. This can be
utilized for overloading in some of the operations.

Change-Id: I58a8186b3ef647650280e63f3e5e9b9de7827b40
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 782265
Reviewed-on: http://review.gluster.com/2960
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-03-22 16:40:27 -07:00
Raghavendra G
598ab12c30 mount/fuse-bridge: don't pass flags O_CREAT | O_EXCL during open as part of
fd-migration during graph-switch

Change-Id: Ia1494941d3e3d5bebdba3483b0ea7b32c9704b8c
BUG: 802710
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/2943
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-03-18 00:34:23 -07:00
Raghavendra G
1e5653165a fuse-bridge/graph-cleanup: don't provide a cbk for cleanup syncop task
without a cbk, syntask_new returns only after the task is complete.
Hence we don't have to wait on a conditional variable in the caller.

Change-Id: Ie83894aa6fc02cc3a973930e67ae2b35de3b7647
BUG: 767862
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/2870
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-14 03:57:32 -07:00
Csaba Henk
e1ab347720 cleanup and fix xattr namespace flip
- function of actual flipping made static
- clean out references to particular namespaces from flipping logic
- namespaces involved in flipping defined at single location
- fix fnmatch(3) invocation with reversed pattern and string arguments
- instead of "user", use "system" to flip from, because latter is
  free from supervision of the VFS layer (cf. attr(5))

Change-Id: I3cc5836fadcad5b237fd5c67d0dcaea63aee9164
BUG: 798716
Signed-off-by: Csaba Henk <csaba@redhat.com>
Reviewed-on: http://review.gluster.com/2890
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
2012-03-07 23:05:37 -08:00
Rajesh Amaravathi
6756245b15 fops/removexattr: prevent users from removing glusterfs xattrs
* Each xlator prevents the user from removing xlator-specific
  xattrs like trusted.gfid by handling it in respective removexattr
  functions.

* For xlators which did not define remove and fremovexattr,
  the functions have been implemented with appropriate checks.

xlator         |     fops-added
_______________|__________________________
               |
1. stripe      |     removexattr and fremovexattr
2. quota       |     removexattr and fremovexattr

Change-Id: I98e22109717978134378bc75b2eca83fefb2abba
BUG: 783525
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.com/2836
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
2012-03-05 09:17:47 -08:00
Amar Tumballi
f37fcaab9e mount.glusterfs: multiple fixes
* fix return value in case of proper 'backup-volfile-server' option,
  and actual default server based mount failed.

* fix a syntax error (bug: 796050)

Change-Id: I6a530c9b9431e46f45ec9eeb99f6103386dd10dc
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 796101
Reviewed-on: http://review.gluster.com/2798
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-22 04:17:55 -08:00
Amar Tumballi
bca46fd46b rpc/clnt: handle PARENT_DOWN event appropriately
Change-Id: I4644e944bad4d240d16de47786b9fa277333dba4
BUG: 767862
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Reviewed-on: http://review.gluster.com/2735
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-21 01:42:42 -08:00
Raghavendra G
7197111677 fuse-bridge: Handle graph-switch.
The purpose of this patch is to let protocol/client know when its transports can
be disconnected, without application running on gluster mount noticing any
effects of graph switch.

In order to do this, we migrate all fds and blocked locks to new graph.
Once this migration is complete and there are no in-transit frames as viewed
by fuse-bridge, we send a PARENT_DOWN event to its children. protocol/client
on receiving this event, can disconnect up its transports.

Change-Id: Idcea4bc43e23fb077ac16538b61335ebad84ba16
BUG: 767862
Reviewed-on: http://review.gluster.com/2734
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-21 01:05:14 -08:00
Mohammed Junaid
f764516c2e protocol/client,server: fcntl lock self healing.
Currently(with out this patch), on a disconnect the server cleans up
the transport which inturn closes the fd's and releases the locks acquired on
those fd's by that client. On a reconnect, client just reopens the fd's but
doesn't reacquire the locks. The application that had previously acquired
the locks still is under the assumption that it is the owner of those locks
which might have been granted to other clients(if they request) by the server
leading to data corruption.

This patch allows the client to reacquire the fcntl locks (held on the fd's)
during client-server handshake.

* The server identifies the client via process-uuid-xl (which is a combination
  of uuid and client-protocol name, it is assumed to be unique) and lk-version
  number.

* The client maintains a list of process-uuid-xl, lk-version pair for each
  accepted connection. On a connect, the server traverses the list for a
  matching pair, if a matching pair is not found the the server returns
  lk-version with value 0, else it returns the lk-version it has in store.

* On a disconnect, the server and client enter grace period, and on the
  completion of the grace period, the client bumps up its lk-version number
  (which means, it will reacquire the locks the next time) and the server will
  distroy the connection. If reconnection happens within the grace period, the
  server will find the matching (process-uuid-xl, lk-version) pair in its list
  which guarantees that the fd's and there corresponding locks are still valid
  for this client.

Configurable options:
  To set grace-timeout, the following options are
    option server.grace-timeout value
    option client.grace-timeout value

  To enable or disable the lk-heal,
    option lk-heal [on|off]

gluster volume set command can be used to configurable options
Change-Id: Id677ef1087b300d649f278b8b2aa0d94eae85ed2
BUG: 795386
Signed-off-by: Mohammed Junaid <junaid@redhat.com>
Reviewed-on: http://review.gluster.com/2766
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-20 04:45:31 -08:00
Amar Tumballi
c0b8e886ca iobuf: use 'iobuf_get2()' to get variable sized buffers
added 'TODO' in places where it is missing.

Change-Id: Ia802c94e3bb76930f7c88c990f078525be5459f5
Signed-off-by: Amar Tumballi <amar@gluster.com>
BUG: 765264
Reviewed-on: http://review.gluster.com/388
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-20 00:46:27 -08:00
Raghavendra Bhat
b016fe67b6 mount/fuse: unref the fd from resolve to avoid fd leak
Change-Id: I162e07219b98669bc6e09784830ca9407518fd8b
BUG: 794618
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-on: http://review.gluster.com/2760
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-17 04:20:21 -08:00
Amar Tumballi
0e6df0100e core: add an extra flag to readv()/writev() API
needed to implement a proper handling of open flag alterations
using fcntl() on fd.

Change-Id: Ic280d5db6f1dc0418d5c439abb8db1d3ac21ced0
Signed-off-by: Amar Tumballi <amar@gluster.com>
BUG: 782265
Reviewed-on: http://review.gluster.com/2723
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-02-14 01:09:02 -08:00
Anand Avati
8e81cbacc5 fuse: fix resolver to handle graph switches properly
perform resolution on the latest graph by caching it in state->itable
and use fuse_nodeid as just a hint to the possible final resolved inode
(in case it was resolved off the latest graph). GFID is the primary key
for resolving inodes on the latest graph.

Change-Id: I3921c6f59c9ff80e4ff076bec3bd334423fc36cc
BUG: 785675
Reviewed-on: http://review.gluster.com/2703
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amar@gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
2012-02-08 03:13:08 -08:00
Rajesh Amaravathi
1969ef1759 mount/fuse: check for existence of volfiles
If glusterd is not running in the client host and/or
if there are no volume created yet, this patch ensures
that appropriate error message is displayed

Change-Id: I15d23a45d70aa27bbdd42f435fe705b14c779e3f
BUG: 786077
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.com/2708
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amar@gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-07 02:47:21 -08:00
Kaushal M
08041c3212 protocol/client : prevent client from reconnecting when server
authentication fails

This prevents the client from trying to reconnect on server
authentication failure. Reconnecting on authentcation failure causes hung
mounts on unauthorised clients. This patch fixes this problem.

Also, mount.glusterfs script unmounts mount-point on mount failure to
prevent hung mounts.

Change-Id: I5615074d27948077bad491a38cecae1b7f5159fb
BUG: 765240
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/398
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amar@gluster.com>
2012-02-03 07:41:51 -08:00
Amar Tumballi
49c325d949 complete the implementation of missing 'f**xattr()' fops
in debug/* and cluster/* translators and a syncop_fsetxattr()

added a test case for testing the working of 'f-fop()' on
fuse mount.

Change-Id: I0c2aeeb30a0fb382ef2495cca1e66b00abaffd35
Signed-off-by: Amar Tumballi <amar@gluster.com>
BUG: 766571
Reviewed-on: http://review.gluster.com/802
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
2012-01-25 02:26:51 -08:00
Amar Tumballi
d7ecaaa1ed core: add 'fremovexattr()' fop
so operations can be done on fd for extended attribute removal

Change-Id: Ie026f1b53793aeb4ae33e96ea5408c7a97f34bf6
Signed-off-by: Amar Tumballi <amar@gluster.com>
BUG: 766571
Reviewed-on: http://review.gluster.com/778
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
2012-01-25 02:24:20 -08:00
Amar Tumballi
cf8486cbef core: get xattrs also as part of readdirp
readdirp_req() call sends a dict_t * as an argument, which
contains all the xattr keys for which the entries got in
readdirp_rsp() are having xattr value filled dictionary.

Change-Id: I8b7e1290740ea3e884e67d19156ce849227167c0
Signed-off-by: Amar Tumballi <amar@gluster.com>
BUG: 765785
Reviewed-on: http://review.gluster.com/771
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
2012-01-25 02:03:44 -08:00
Amar Tumballi
b02afc6d00 core: change lk-owner as a 1k buffer
so, NLM can send the lk-owner field directly to the locks translators,
while doing the same effort, also enabled sending maximum of 500 aux gid
over protocol.

Change-Id: I87c2514392748416f7ffe21d5154faad2e413969
Signed-off-by: Amar Tumballi <amar@gluster.com>
BUG: 767229
Reviewed-on: http://review.gluster.com/779
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
2012-01-24 20:14:17 -08:00
Anand Avati
7e1f8e3bac core: GFID filehandle based backend and anonymous FDs
1. What
--------
This change introduces an infrastructure change in the filesystem
which lets filesystem operation address objects (inodes) just by its
GFID. Thus far GFID has been a unique identifier of a user-visible
inode. But in terms of addressability the only mechanism thus far has
been the backend filesystem path, which could be derived from the
GFID only if it was cached in the inode table along with the entire set
of dentry ancestry leading up to the root.

This change essentially decouples addressability from the namespace. It
is no more necessary to be aware of the parent directory to address a
file or directory.

2. Why
-------
The biggest use case for such a feature is NFS for generating
persistent filehandles. So far the technique for generating filehandles
in NFS has been to encode path components so that the appropriate
inode_t can be repopulated into the inode table by means of a recursive
lookup of each component top-down.

Another use case is the ability to perform more intelligent self-healing
and rebalancing of inodes with hardlinks and also to detect renames.

A derived feature from GFID filehandles is anonymous FDs. An anonymous FD
is an internal USABLE "fd_t" which does not map to a user opened file
descriptor or to an internal ->open()'d fd. The ability to address a file
by the GFID eliminates the need to have a persistent ->open()'d fd for the
purpose of avoiding the namespace. This improves NFS read/write performance
significantly eliminating open/close calls and also fixes some of today's
limitations (like keeping an FD open longer than necessary resulting
in disk space leakage)

3. How
-------

At each storage/posix translator level, every file is hardlinked inside
a hidden .glusterfs directory (under the top level export) with the name
as the ascii-encoded standard UUID format string. For reasons of performance
and scalability there is a two-tier classification of those hardlinks
under directories with the initial parts of the UUID string as the directory
names.

For directories (which cannot be hardlinked), the approach is to use a symlink
which dereferences the parent GFID path along with basename of the directory.
The parent GFID dereference will in turn be a dereference of the grandparent
with the parent's basename, and so on recursively up to the root export.

4. Development
---------------

4a. To leverage the ability to address an inode by its GFID, the technique is
to perform a "nameless lookup". This means, to populate a loc_t structure as:

loc_t {
   pargfid: NULL
   parent: NULL
   name: NULL
   path: NULL
   gfid: GFID to be looked up [out parameter]
   inode: inode_new () result [in parameter]
}

and performing such lookup will return in its callback an inode_t
populated with the right contexts and a struct iatt which can be
used to perform an inode_link () on the inode (without a parent and
basename). The inode will now be hashed and linked in the inode table
and findable via inode_find().

A fundamental change moving forward is that the primary fields in a
loc_t structure are now going to be (pargfid, name) and (gfid) depending
on the kind of FOP. So far path had been the primary field for operations.
The remaining fields only serve as hints/helpers.

4b. If read/write is to be performed on an inode_t, the approach so far
has been to: fd_create(), STACK_WIND(open, fd), fd_bind (in callback) and
then perform STACK_WIND(read, fd) etc. With anonymous fds now you can do
fd_anonymous (inode), STACK_WIND (read, fd). This results in great boost
in performance in the inbuilt NFS server.

5. Misc
-------
The inode_ctx_put[2] has been renamed to inode_ctx_set[2] to be consistent
with the rest of the codebase.

Change-Id: Ie4629edf6bd32a595f4d7f01e90c0a01f16fb12f
BUG: 781318
Reviewed-on: http://review.gluster.com/669
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
2012-01-20 05:03:42 -08:00
Rajesh Amaravathi
36cedb338e core/setxattr: prevent users from setting glusterfs xattrs
* Each xlator prevents the user from setting glusterfs-internal
xattrs like trusted.gfid by handling it in respective setxattr
functions. The speacial case of trusted.gfid is handled in
fuse (Not in posix because posix_setxattr is used to set gfid).

* For xlators which did not define setxattr and/or fsetxattr,
the functions have been implemented with appropriate checks.

xlator         |     fops-added
_______________|__________________________
               |
1. afr         |     fsetxattr
2. stripe      |     setxatrr and fsetxattr
3. quota       |     setxattr and fsetxattr

Change-Id: Ib62abb7067415b23a708002f884d30e8866fbf48
BUG: 765487
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.com/685
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amar@gluster.com>
2012-01-14 04:57:59 -08:00
Kaleb KEITHLEY
3007bdddb1 don't try to get ngroups from /proc on non-Linux systems
Emmanual Dreyfus abandoned his changes, seemingly because he couldn't
get rfc.sh to correctly generate his changed patch set. Since Mac OS
is an important port, I suggest we keep this change alive. (This
change also works on the other BSDs too)

Now with added Solaris support

BUG: 764655
Change-Id: I6a9ab7383777f9a09ab5c9a6914f45eee43461fb
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.com/2617
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amar@gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
2012-01-14 04:51:20 -08:00
Lubomir Rintel
8a78d969ee fuse-bridge: preserve original mode and umask
FUSE used to interpret the umask itself. That was a bad idea, since
there are cases where umask is not applied, such as when extended POSIX
ACLs are present and default ACLs are set on parent directory.

Thus, FUSE was changed to pass umask to operation handler itself in case
the fuse server is initialized with FUSE_DONT_MASK. In case FUSE
supports it, gluster client sends mode unmasked and umask separately (
masked mode is still sent, for compatibility with old servers).
the mode as-is for compatibility with older clients.

Change-Id: I55862b39a25261446f18ba0b3c03f85b41c4d722
Signed-off-by: Lubomir Rintel <lubo.rintel@gooddata.com>
Tested-by: Lubomir Rintel <lubo.rintel@gooddata.com>
BUG: 765508
Reviewed-on: http://review.gluster.com/667
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
2012-01-12 09:11:54 -08:00
Pranith Kumar K
4e40a7e487 mount/fuse: Fix memory leaks
Change-Id: Iff10650dc8234f9d8ca0472f2e1ea9c60fbd6d4e
BUG: 773211
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2630
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Anand Avati <avati@gluster.com>
2012-01-11 08:39:33 -08:00
Harshavardhana
d2b6d69023 mount/fuse: Cleanup / remove unnecessary comments
Change-Id: If236e82c2e89d2ab4a0e3278319976aeb9fc05a6
BUG: 769691
Signed-off-by: Harshavardhana <fharshav@redhat.com>
Reviewed-on: http://review.gluster.com/2491
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Csaba Henk <csaba@gluster.com>
2011-12-28 22:17:47 -08:00
Rajesh Amaravathi
7235e5b1af mount/fuse: export PATH for which in mount script
exporting PATH environment variable for mount.glusterfs.in
to correct the "which: no getfattr in ((null))" error
during fuse mount.

Change-Id: Id7d024c0d1cf3d265489557897e9e1f8e7ce4ce4
BUG: 765561
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.com/782
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Amar Tumballi <amar@gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2011-12-13 09:43:36 -08:00
Amar Tumballi
1d38ec6ce4 fuse: bring in the reverse invalidation
Thanks to Csaba Henk <csaba@gluster.com> for the patch

Currently one can invalidate the inodes using 'setxattr()' with
key 'inode-invalidate' (and any value). This can be further
extended to do a purge of inode table itself.

Change-Id: I165d5d585ed808b9e463ac0aad859ec64568c7a2
BUG: 762277
Signed-off-by: Amar Tumballi <amar@gluster.com>
Reviewed-on: http://review.gluster.com/324
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
2011-12-12 02:15:12 -08:00
Raghavendra G
f5d5e8012a mount/fuse: Inherit direct-io-mode values from fds already
opened, for a new fd being opened.

When an fd is being opened, it inherits direct-io-mode characterstics
(either enabled or disabled) from the fds already opened on inode. If none
are opened and user has not specified the mode through cmdline options,
default mode is used.

Change-Id: I0c9e959100e9130e46bbd16d63eca278260635b4
BUG: 801
Reviewed-on: http://review.gluster.com/55
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Csaba Henk <csaba@gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
2011-12-01 22:02:39 -08:00
Kaushal M
33477a140f fuse: enable kernel read-only mode
Enables kernel read-only mode on mounting with '-oro' and disables the gluster
read-only translator from being loaded. As a result, '-oro' is reported
correctly in the mount options.

Change-Id: If94d97836b13668974cfac61b6e5d52e19880e10
BUG: 3742
Reviewed-on: http://review.gluster.com/655
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Csaba Henk <csaba@gluster.com>
2011-11-22 19:46:06 -08:00
Harshavardhana
51a78ad316 glusterfs: An effort to fix all the spell mistakes and typo
in the entire glusterfs codebase.

This patch fixes many of spell mistakes and typo in the entire
glusterfs codebase and all supported modules.

Change-Id: I83238a41aa08118df3cf4d1d605505dd3cda35a1
BUG: 3809
Signed-off-by: Harshavardhana <fharshav@redhat.com>
Reviewed-on: http://review.gluster.com/731
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amar@gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2011-11-16 21:08:56 -08:00
Amar Tumballi
8c182c6bf7 core: remove 'ino' variable from 'loc_t' structure
Change-Id: I53b007fbdb42313d207d5d63fbfaaa6aaf033f95
BUG: 3518
Reviewed-on: http://review.gluster.com/523
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2011-11-16 03:45:11 -08:00
Amar Tumballi
14f4e02382 core: remove 'ino' variable from 'inode_t' structure
Change-Id: I0f078d1753db65d2f2e0380d1b0450c114cf40dd
BUG: 3518
Reviewed-on: http://review.gluster.com/522
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2011-11-16 03:44:32 -08:00
Rajesh Amaravathi
bb67817cf5 debug/io-stats: prevent setfattr crash when no value given
Check for whether the dump file is given, and proceed
on success. If dump file is not given, unwind with ENOENT.

Change-Id: If524a2b20d643e0e75d81daebe59560a78000524
BUG: 3716
Reviewed-on: http://review.gluster.com/663
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amar@gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
2011-11-11 02:09:48 -08:00
Rajesh
cb9ffbe767 mount/fuse: check for recursive mounts
Adding check_recursive_mount() in mount.glusterfs.in
to check if mount point is in the lineage of any
brick path. Gracefully fails if mount point leads
to recursive mount.

Change-Id: Iedc4cd767d241c8e256181e472c0815f3831a316
BUG: 2003
Reviewed-on: http://review.gluster.com/314
Reviewed-by: Amar Tumballi <amar@gluster.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
2011-11-11 02:01:28 -08:00
Venky Shankar
a29f1a0e36 fuse: flip xattr key from user to trusted namespace for certain
clients.

This is needed for gsyncd/hadoop-plugin running as non-super
user to be able to request extended attributes under trusted
namespace. Request for a key is made under 'user.' namespace
and is flipped by fuse xlator for specific xattr name to the
corresponding 'trusted.' extended attribute.

Both applications set a identifier (client-pid) while doing a
FUSE mount, which is checked by get/set/remove interfaces in
FUSE translator.

Change-Id: I72f77a5dd1ee1d69c8b0e09209449348dbcf879a
BUG: 3701
Reviewed-on: http://review.gluster.com/563
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2011-10-28 08:08:40 -07:00
Pranith Kumar K
ae78820311 mount/fuse: set gfid in lookup after a failed revalidate lookup
Change-Id: I1904aa63d9365ebda3e979449454ac08db85d93d
BUG: 3747
Reviewed-on: http://review.gluster.com/636
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amar@gluster.com>
2011-10-28 05:00:54 -07:00
Amar Tumballi
84ebee8c20 build: warning suppression (round n)
with this patch, there are no more warnings with gcc (GCC) 4.6.1 20110908

Change-Id: Ice0d52d304b9846395f8a4a191c98eb53125f792
BUG: 2550
Reviewed-on: http://review.gluster.com/607
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
2011-10-20 04:13:50 -07:00