11646 Commits

Author SHA1 Message Date
Poornima G
7022bcf769 readdir-ahead: Fix an issue with parallel-readdir and readdir-optimize
Issue: When parallel-readdir is enabled, readdir-optimize automatically
stops working because of a bug in rda_opendir.

RCA: In rda_opendir, the xattrs that indicate readdir-optimize or not
is sent in xdata. This xdata is sent to all the readdirp prefetch
calls. A dict_ref is taken on xdata and kept in rda_opendir to be
used by rda_fill_fd, but dht_opendir deletes some elements in xdata
after calling rda_opendir. Hence dict_ref is not a right choice here,
dict_copy needs to used.

Change-Id: Ie7cc7ceb03117dd4179ef7905647f2f123f94966
fixes: bz#1578650
Signed-off-by: Poornima G <pgurusid@redhat.com>
2018-05-17 06:47:52 +00:00
Amar Tumballi
7ac79fb033 client/protocol: fix the log level for removexattr_cbk
noticed that server protocol actually logs all the errors for
removexattr as INFO, instead of WARNING like client, and hence,
doesn't create a confusion in user.

updates: bz#1576418
Change-Id: Ia6681e9ee433fda3c77a4509906c78333396e339
Signed-off-by: Amar Tumballi <amarts@redhat.com>
2018-05-17 04:05:49 +00:00
Pranith Kumar K
9ead9a6690 statedump: Prevent duplicate statedump for master and active
Csaba found that statedump of fusemount has two instances of
each of the mem-accounting information. On debugging, I realized
that statedump is called for both ctx->master and ctx->active.
Since ctx->active is a sub-graph of ctx->master, there are duplicate
entries. Fixed this part to prevent duplication in this patch.

fixes bz#1578721
BUG: 1578721
Change-Id: I5a63b4f5933d4d720ac010c58e6dee3b27067d42
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
2018-05-16 14:57:53 +05:30
Sanju Rakonde
f631ceb79e cli: Fix for gluster volume info --xml
Problem: gluster volume info --xml is showing same uuid to all
the bricks of a tier volume.

Solution: While iterating over hot/cold bricks of a tier volume, use
correct iterator.

Fixes: bz#1577627
Change-Id: Icf6a9c2a10b9da453abc262a57b7884d6638e3ed
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
2018-05-15 05:18:45 +00:00
Mohit Agrawal
8e2289b1e7 glusterfs: Resolve brick crashes at the time of inode_unref
Problem: Sometimes brick process is getting crash at the time
         of calling inode_unref in fd_destroy

Solution: Brick process is getting crash because inode is already
          free by xlator_mem_cleanup call by server_rpc_notify.To
          resolve the same move code specific to call transport_unref
          in last in free_state.

BUG: 1577574
Change-Id: Ia517c230d68af4e929b6b753e4c374a26c39dc1a
fixes: bz#1577574
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
2018-05-15 02:37:55 +00:00
Kotresh HR
829f32c61c geo-rep/scheduler: Fix crash
Fix crash where session_name is referenced
before assignment. Well, this is a corner
case where the geo-rep session exists and
the status output doesn't show any rows.
This might happen when glusterd is down
or when the system is in inconsistent state
w.r.t glusterd.

fixes: bz#1576179
Change-Id: Iec1557e01b35068041b4b3c1aacee2bfa0e05873
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2018-05-14 06:45:02 +00:00
Kotresh HR
57632e3c1a glusterd/geo-rep: Fix glusterd crash
Using strdump instead of gf_strdup crashes
during free if mempool is being used.
gf_free checks the magic number in the
header which will not be taken care if
strdup is used.

fixes: bz#1576392
Change-Id: Iab36496554b838a036af9d863e3f5fd07fd9780e
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2018-05-12 09:06:32 +00:00
hari gowtham
1ef9270c09 Glusterfsd: brick crash during get-state
The xprt's dereferencing wasn't checked before using it for the
strcmp, which caused the segfault and crashed the brick process.

fix: Check every deferenced variable before using it.

Change-Id: I7f705d1c88a124e8219bb877156fadb17ecf11c3
fixes: bz#1575864
Signed-off-by: hari gowtham <hgowtham@redhat.com>
2018-05-11 10:54:48 +00:00
Varsha Rao
021b60858c libglusterfs/stack: Fix coverity issue
Fix ARRAY_VS_SINGLETON coverity issue.

Change-Id: I9e70be026e80011dfc8fb0f06c4563895eb6daf4
fixes: bz#1558574
Signed-off-by: Varsha Rao <varao@redhat.com>
2018-05-11 05:54:06 +00:00
Mohit Agrawal
08dcb1c2bf dht: Excessive 'dict is null' logs in dht_discover_complete
Problem: In Geo-Rep setup excessive "dict is null" logs in
         dht_discover_complete while xattr is NULL

Solution: To avoid the logs update a condition in dht_discover_complete

BUG: 1576767
Change-Id: Ic7aad712d9b6d69b85b76e4fdf2881adb0512237
fixes: bz#1576767
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
2018-05-11 04:36:27 +00:00
Kaleb S. KEITHLEY
b4ce5e090d gfapi: various broken symbol versions
lots of breakage in symbol versions:
  symbols added in 4.1 incorrectly, and
  symbols added in 4.1 but labeled 4.0.0, and
  symbols added in 3.13 incorrectly

Not noticed until someone tried to build 3.13.2 on FreeBSD 11.1,
despite the fact that we build on FreeBSD 10.3 IIRC, somehow the
3.13 errors aren't a build error there.

Note: in rereading the Ulrich Drepper write-up I noticed that when
a symbol version is changed, you are supposed to leave the old
symbol in its original section in addition to adding it to its new
section. Adding back those symbols to their original sections.

Reported-by: Roman Serbski <mefystofel@gmail.com>

Change-Id: I9a883546d08e0847f7228d8ea5943bc54275b319
fixes: bz#1575716
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
2018-05-10 11:15:18 -04:00
Anoop C S
e471c2a781 features/cloudsync: Remove multiple definition in Makefile.am
CLOUDSYNC_SRC is defined twice in the same Makefile.am which generates
the following warning:

xlators/features/cloudsync/src/Makefile.am:9: warning: CLOUDSYNC_SRC multiply defined in condition TRUE ...
xlators/features/cloudsync/src/Makefile.am:5: ... 'CLOUDSYNC_SRC' previously defined here

Therefore removing the duplicate definition.

Change-Id: I00c3e2f3d64ad45e4080c2c82766516cd3e2bf63
fixes: bz#1193929
BUG: 1193929
Signed-off-by: Anoop C S <anoopcs@redhat.com>
2018-05-10 11:37:08 +00:00
Kaleb S. KEITHLEY
2b2410acb4 core: FreeBSD has pthread_set_name_np() (versus pthread_setname_np())
And has had it since at least FreeBSD 9.0

Reported-by: Roman Serbski <mefystofel@gmail.com>

Change-Id: I52cfde7f2f7a82d0e66465ac392ed7e201e1653b
updates: bz#1193929
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
2018-05-09 08:58:34 -04:00
Sanoj Unnikrishnan
8d1335af80 Quota: Turn on ssl for crawler clients if needed
Problem: Quota uses per brick client generated by
glusterd_generate_client_per_brick_volfile to crawl the
individual bricks. These clients were not being configured
with ssl if volume has client.ssl turned on.

Solution: turn on client.ssl if the volume has client.ssl
option set to on.

Change-Id: Id3a13d5110c4376d734480c42da1ce6844cc8240
fixes: bz#1575858
Signed-off-by: Sanoj Unnikrishnan <sunnikri@redhat.com>
2018-05-09 07:04:20 +00:00
N Balachandran
2d3b44641d cluster/dht: Debug virtual xattrs for dht
Provide a virtual xattr with which to query
the hashed subvol for a file.

Change-Id: Ic7abd031f875da4b9084841ea7c25d6c8a851992
fixes: bz#1574421
Signed-off-by: N Balachandran <nbalacha@redhat.com>
2018-05-09 03:46:36 +00:00
N Balachandran
d3e3b11d38 cluster/dht: Debug logs in dht_readdir(p)_cbk
Additional log messages to help debug issues
with file listings.

Change-Id: Iccd07498ba01d597c0c40f026f4177dd06d7e901
fixes: bz#1575887
Signed-off-by: N Balachandran <nbalacha@redhat.com>
2018-05-09 03:45:27 +00:00
Amar Tumballi
52d9b8bcd5 protocol/server: don't assume there would be a volfile id
Earlier glusterfs never had an assumption someone would start it with
right arguments, and brick processes would be spawned by a management
layer. It just assume the role based on the volfile. Other than
volfile, no other arguments should be technically mandatory for
working of glusterfs. With this patch, that assumption holds true.

Updates: github issue # 352

A note on why this particular issue for this basic sanity?

As per the design of thin-arbiter/tie-breaker, it can be started
independently on any machine, without need of glusterd. So, similar
to 'glusterd', we should be able to spawn a process with any translator
without options/volume id etc.

fixes: bz#1569399
Change-Id: I5c0650fe0bfde35ad94ccba60e63f6cdcd1ae5ff
Signed-off-by: Amar Tumballi <amarts@redhat.com>
2018-05-08 21:16:24 +00:00
Mohit Agrawal
ed5a09e4ae dht: Avoid dict log flooding for internal MDS xattr
Problem: Before populate MDS internal xattr first dht checks if MDS is
         present in xattr or not.If xattr dictionary is NULL dict_get
         log the message either dict or key is NULL

Solution: Before call dict_get check xattr, if it is NULL then no
          need to call dict_get.

BUG: 1575910
Change-Id: I81604ec5945b85eba14b42f4583d06ec713028f4
fixes: bz#1575910
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
2018-05-08 15:15:27 +05:30
ShyamsundarR
38fa8b983b glusterd: Update op-version for master
Updated the op-version on master to the next release
op-version, for any future options appearing on master.

Fixes: bz#1575742
Change-Id: I861d489573360e6679c6f5ffe127835ea71f2dda
Signed-off-by: ShyamsundarR <srangana@redhat.com>
2018-05-08 03:46:14 +00:00
Michael Adam
f8b6795b23 heal: improve output of heal info
The output of "gluster volume heal <volume> info" is clobbered with
extra new lines when messages "- Possibly undergoing heal" or " - Is in
split-brain" are printed for listed files.

This patch fixes the output by removing the extra new lines.

Bug: 1575381

Change-Id: Ifb614e0fb7c85f7af3a799958d3645a2bff2b53a
fixes: bz#1575381
Signed-off-by: Michael Adam <obnox@samba.org>
2018-05-08 00:17:20 +00:00
Amar Tumballi
4b046827b9 fuse: make sure the send lookup on root instead of getattr()
This change was done in https://review.gluster.org/16945. While the
changes added there were required, it was not necessary to remove the
getattr part. As fuse's lookup on root(/) comes as getattr only, this
change is very much required.

The previous fix for this bug was to add the check for revalidation in
lookup when it was sent on root. But I had removed the part where
getattr is coming on root. The removing was not requried to fix the
issue then. Added back this part of the code, to make sure we have
proper validation of root inode in many places like acl, etc.

updates: bz#1437780
Change-Id: I859c4ee1a3f407465cbf19f8934530848424ff50
Signed-off-by: Amar Tumballi <amarts@redhat.com>
2018-05-07 19:41:41 +00:00
Sanju Rakonde
4da244cacc glusterd: handling brick termination in brick-mux
Problem: There's a race between the glusterfs_handle_terminate()
response sent to glusterd from last brick of the process and the
socket disconnect event that encounters after the brick process
got killed.

Solution: When it is a last brick for the brick process, instead of
sending GLUSTERD_BRICK_TERMINATE to brick process, glusterd will
kill the process (same as we do it in case of non brick multiplecing).

The test case is added for https://bugzilla.redhat.com/show_bug.cgi?id=1549996

Change-Id: If94958cd7649ea48d09d6af7803a0f9437a85503
fixes: bz#1545048
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
2018-05-07 15:31:59 +00:00
Kotresh HR
23c1385b5f geo-rep: Fix upgrade issue
Cause and Analysis:
The last synced changelog for entry operations is
marked in current version to avoid re-processing
of already processed entry operations in a batch
during crash/restart of geo-rep. This was not
present in previous versoins.

The marker is maintained in the dictionary with the
key 'last_synced_entry' and dictionary is persisted
into status file. So upgrading to current version in
which the marker is present was failing with KeyError.

Solution:
Load the dictionary with default keys first which
contains all the keys including latest ones and then
load the values from status file instead of doing
otherwise.

fixes: bz#1575490
Change-Id: Ic654e6f9a3c97f616761f1362f890352a2186fb4
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2018-05-07 10:17:15 +00:00
Raghavendra G
5e356e3f47 cluster/dht: fixes to parallel renames to same destination codepath
Test case:
 # while true; do uuid="`uuidgen`"; echo "some data" > "test$uuid"; mv
   "test$uuid" "test" -f || break; echo "done:$uuid"; done

 This script was run in parallel from multiple mountpoints

Along the course of getting the above usecase working, many issues
were found:

Issue 1:
=======
consider a case of rename (src, dst). We can encounter a situation
where,
* dst is a file present at the time of lookup
* dst is removed by the time rename fop reaches glusterfs

In this scenario, acquring inodelk on dst fails with ESTALE resulting
in failure of rename. However, as per POSIX irrespective of whether
dst is present or not, rename should be successful. Acquiring entrylk
provides synchronization even in races like this.

Algorithm:
1. Take inodelks on src and dst (if dst is present) on respective
   cached subvols. These inodelks are done to preserve backward
   compatibility with older clients, so that synchronization is
   preserved when a volume is mounted by clients of different
   versions. Once relevant older versions (3.10, 3.12, 3.13) reach
   EOL, this code can be removed.
2. Ignore ENOENT/ESTALE errors of inodelk on dst.
3. protect namespace of src and dst. To protect namespace of a file,
   take inodelk on parent on hashed subvol, then take entrylk on the
   same subvol on parent with basename of file. inodelk on parent is
   done to guard against changes to parent layout so that hashed
   subvol won't change during rename.
4. <rest of rename continues>
5. unlock all locks

Issue 2:
========
linkfile creation in lookup codepath can race with a rename. Imagine
the following scenario:
* lookup finds a data-file with gfid - gfid-dst - without a
  corresponding linkto file on hashed-subvol. It decides to create
  linkto file with gfid - gfid-dst.
    - Note that some codepaths of dht-rename deletes linkto file of
      dst as first step. So, a lookup racing with an in-progress
      rename can easily run into this situation.
* a rename (src-path:gfid-src, dst-path:gfid-dst) renames data-file
  and hence gfid of data-file changes to gfid-src with path dst-path.
* lookup proceeds and creates linkto file - dst-path - with gfid -
  dst-gfid - on hashed-subvol.
* rename tries to create a linkto file dst-path with src-gfid on
  hashed-subvol, but it fails with EEXIST. But EEXIST is ignored
  during linkto file creation.

Now we've ended with dst-path having different gfids - dst-gfid on
linkto file and src-gfid on data file. Future lookups on dst-path will
always fail with ESTALE, due to differing gfids.

The fix is to synchronize linkfile creation in lookup path with rename
using the same mechanism of protecting namespace explained in solution
of Issue 1. Once locks are acquired, before proceeding with linkfile
creation, we check whether conditions for linkto file creation are
still valid. If not, we skip linkto file creation.

Issue 3:
========
gfid of dst-path can change by the time locks are acquired. This
means, either another rename overwrote dst-path or dst-path was
deleted and recreated by a different client. When this happens,
cached-subvol for dst can change. If rename proceeds with old-gfid and
old-cached subvol, we'll end up in inconsistent state(s) like dst-path
with different gfids on different subvols, more than one data-file
being present etc.

Fix is to do the lookup with a new inode after protecting namespace of
dst. Post lookup, we've to compare gfids and correct local state
appropriately to be in sync with backend.

Issue 4:
========
During revalidate lookup, if following a linkto file doesn't lead to a
valid data-file, local->cached-subvol was not reset to NULL. This
means we would be operating on a stale state which can lead to
inconsistency. As a fix, reset it to NULL before proceeding with
lookup everywhere.

Issue 5:
========
Stale dentries left out in inode table on brick resulted in failures
of link fop even though the file/dentry didn't exist on backend fs. A
patch is submitted to fix this issue. Please check the dependency tree
of current patch on gerrit for details

In short, we fix the problem by not blindly trusting the
inode-table. Instead we validate whether dentry is present by doing
lookup on backend fs.

Change-Id: I832e5c47d232f90c4edb1fafc512bf19bebde165
updates: bz#1543279
BUG: 1543279
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
2018-05-07 06:04:10 +00:00
Raghavendra G
01a7d27bba cluster/dht: log error only if layout healing is required
selfhealing of directory is invoked on two conditions:
1. no layout on disk or layout has some anomalies (holes/overlaps)
2. mds xattr is not set on the directory

When dht_selfheal_directory is called with a correct layout just to
set mds xattr, we see error msgs complaining about "not able to form
layout on directory", which is misleading as the layout is
correct. So, log this msg only if layout has anomalies.

Change-Id: I4af25246fc3a2450c2426e9902d1a5b372eab125
updates: bz#1543279
BUG: 1543279
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
2018-05-07 05:37:06 +00:00
Anoop C S
3313113146 extras/hooks: Do not blindly remove volume share from smb.conf
When Gluster volumes are shared via Samba, any extra smb.conf parameter
setting done by administrator to those shares are lost during restart
of the volume. Instead of removing the whole share completely from
smb.conf(via hook scripts during volume stop) it is better to make it
temporarily unavailable to end-users till the volume is started again.
Therefore we make use of a smb.conf parameter named 'available'[1] to
achieve the above intend.

[1] https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html

Change-Id: I68a9055b50791f6ffd3b95a3c13d858a75fa6530
fixes: bz#1558921
BUG: 1558921
Signed-off-by: Anoop C S <anoopcs@redhat.com>
2018-05-07 05:04:04 +00:00
Thomas Hindoe Paaboel Andersen
a6490fe021 gfapi: acutally avoid recall callback when closed
Due to missing curly braces we end up calling the callback
function even when state is GLFD_CLOSE. This patch adds the
curly braces so both the log and actual callback is skipped.

  Introduced in 19568 in commit b04066721bf4a240f61b83bd87bbb27437c5fe4f

Change-Id: I0b15cfe222841cfcb12f17723284acb3838d64d7
fixes: bz#1575294
Signed-off-by: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
2018-05-06 11:24:34 +00:00
Sanju Rakonde
9e739aef97 glusterd: Fix for memory leak in volume tier status command
Fixes: bz#1573220
Change-Id: Ia60f40fa4f1e525cae6f571a24e5385ba1e004c0
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
2018-05-06 06:27:57 +00:00
Kotresh HR
17e3f61708 glusterd/ctime: Provide option to enable/disable ctime feature
Updates: #208
Change-Id: If6f52b9b1b5b823ad64faeed662e96ceb848c54c
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2018-05-06 07:09:19 +05:30
Kotresh HR
99cba93daa glusterd/utime: glusterd utime changes
Load utime xlator in the client side just after (below)
performance xlators.

Updates: #208
Change-Id: Ie15f156943fa8e7dac7050e5479c906da747b568
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2018-05-06 07:09:18 +05:30
Kotresh HR
487aaafaca utime: ctime client side xlator
The client side utime xlator does two things.

1. Update unix epoch time in frame->root->ctime
2. Update the frame->root->flags based on the fop
   which indicates time attributes that should be
   updated for the parent/entry.

Credits: Rafi KC <rkavunga@redhat.com>
Updates: #208
Change-Id: I9cad297040c70798a0a8468a080eb4aeff73138d
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2018-05-06 07:09:18 +05:30
Kotresh HR
f8fe0771f0 posix/ctime: posix hook to set ctime xattr in relevant fops
This patch uses the ctime posix APIs to set consistent
time across replica on disk. It also stores the time
attributes in the inode context.

Credits: Rafi KC <rkavunga@redhat.com>
Updates: #208
Change-Id: I1a8d74d1e251f1d6d142f066fc99258025c0bcdd
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2018-05-06 07:09:08 +05:30
Kotresh HR
9a854a98af posix/ctime: posix hooks to get consistent time xattr
This patch uses the ctime posix APIs to get consistent
time across replica. The time attributes are got from
from inode context or from on disk if not found and
merged with iatt to be returned.

Credits: Rafi KC <rkavunga@redhat.com>
Updates: #208
Change-Id: Id737038ce52468f1f5ebc8a42cbf9c6ffbd63850
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2018-05-06 07:06:53 +05:30
Kotresh HR
3e24848f1e posix: APIs in posix to get and set time attributes
This is part of the effort to provide consistent time
across distribute and replica set for time attributes
(ctime, atime, mtime) of the object. This patch contains
the APIs to set and get the attributes from on disk
and in inode context.

Credits: Rafi KC <rkavunga@redhat.com>
Updates: #208
Change-Id: I5d3cba53eef90ac252cb8299c0da42ebab3bde9f
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2018-05-06 01:32:30 +00:00
Poornima G
80262e2984 tests: Add lease test case
Updates: #350
Change-Id: Iee78ab4baf48c481de1e13ff2b0393bc106b7d0e
Signed-off-by: Poornima G <pgurusid@redhat.com>
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
2018-05-05 11:53:59 +00:00
Poornima G
0adede4747 afr: Add lease() fop
Change-Id: Ied047dd5ee44e9d5a5d3db214826f7df30332ef9
updates: #350
BUG: 1319992
Signed-off-by: Poornima G <pgurusid@redhat.com>
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
2018-05-05 11:53:39 +00:00
Csaba Henk
1322274eef mount,fuse: make fuse dumping available as mount option
Updates: bz#1193929
Change-Id: I4dd4d0e607f89650ebb74b893b911b554472826d
Signed-off-by: Csaba Henk <csaba@redhat.com>
2018-05-04 17:42:12 +00:00
Csaba Henk
2ac79ed804 fuse: add support for kernel writeback cache
- Added kernel-writeback-cache command line and xlator
  option for requesting utilisation of the writeback
  cache of the kernel in FUSE_INIT (see [1]).
- Added attr-times-granularity command line and xlator
  option via which granularity of the {a,m,c}time in
  stat (attr) data that we support can be indicated to
  kernel. This is a means to avoid divergence of the
  attr times between kernel and userspace that could
  occur with writeback-cache, while still maintaining
  maximum time precision the FUSE server is capable of
  (see [2]).
- Handling FATTR_CTIME flag in FUSE_SETATTR that
  indicates presence of ctime in setattr payload.
  Currently we cannot associate arbitrary ctimes to
  files on backend, so we just touch them to update
  their ctimes to current time. Having ctimes in setattr
  payload is also a side effect of writeback cache
  (see [3] and [4]).

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4d99ff8,
     "fuse: Turn writeback cache on"
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e27c9d3,
     "fuse: fuse: add time_gran to INIT_OUT"
[3]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1e18bda,
     "fuse: add .write_inode"
[4]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ab9e13f,
     "fuse: allow ctime flushing to userspace"

Updates: #435
Change-Id: Id174c8e0c815c4456c35f8c53e41a6a507d91855
Signed-off-by: Csaba Henk <csaba@redhat.com>
2018-05-04 17:42:12 +00:00
Jiffin Tony Thottan
15866ac977 feature/leases : fixing bugs found while testing glfs_test.t
Change-Id: Iee8f431601ecda184108a079f665e05902b0f78b
updates: #350
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
2018-05-04 17:13:13 +00:00
Soumya Koduri
b04066721b gfapi : RECALL_LEASE implementation
Right now there are two types of upcalls
* poll method
* registering callback

But callback can be registered per fs and same callback fn shall be used
for any lease recall with object handle as argument as done for cache
invalidation.

TODO: RECALL LEASE for each glfd (for future reference)
 (may be needed fo Samba as they do not deal with
  object handles.

    In case of RECALL_LEASE, we could associate separate
     cbk function for each glfd either by
       - extending pub_glfs_lease to accept new args (recall_cbk_fn, cookie)
       - or by defining new API "glfs_register_recall_cbk_fn (glfd, recall_cbk_fn, cookie)
       . In such cases, flag it and instead of calling below upcall functions, define
        a new one to go through the glfd list and invoke each of theirs recall_cbk_fn.

Plus added following as well
* passed lease id to dict in required arguments
* added flag check in pub_glfs_open

Updates: #350
Change-Id: I07a971f0f26ec6aae0b9f9a5613504317dee153b
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Signed-off-by: Poornima G <pgurusid@redhat.com>
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
2018-05-04 17:12:19 +00:00
Raghavendra Bhat
b42a048d3a features/bitrot: print the path of the corrupted objects
Currently "gluster volume bitrot <volume name> scrub status"
gives the list of the corrupted objects (files as of now).
But only the gfids of those corrupted objects are seen and
one has to do getfattr, find etc operations to get the actual
path of those objects for removal etc.

This change makes an attempt to print the path of those files
as much as possible.

* Try to get the path using the on disk gfid2path xattr.

* If the above operation fails, then go for in memory path
(provided that the object has its dentry
properly created and linked in the inode table of the brick where
the corrupted object is present) So the gfid to path resolution is
a soft resolution, i.e. based on the inode and dentry cache in the
brick's memory. If the path cannot be obtained via inode table also,
then only gfid is printed.

Change-Id: Ie9a30307f43a49a2a9225821803c7d40d231de68
fixes: bz#1570962
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
2018-05-04 11:13:57 +00:00
Raghavendra Bhat
bef654f48c use awk to get a specific line from the output instead of cut
cut -d$'\n' is not separating the xattrs shown as part of getfattr output.
Hence use awk to get the nth line of getfattr output for nth iteration
in the for loop.

Change-Id: I1a96cd3f72f4f407f9a783375f78d9a69d5d3885
fixes: bz#1574606
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
2018-05-04 04:51:59 +00:00
Ravishankar N
3aead2facf glusterd: enable self-heal in daemons
..like rebalance, quota and tier because that seems to be the consensus
(see BZ).

Change-Id: I912336a12f4e33ea4ec55f804df403fab0dc89fc
BUG: 1536024
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
2018-05-04 04:50:53 +00:00
Atin Mukherjee
e2ee5cb2ad glusterfsd: initiate pmap_signout for all detach brick requests
In glusterfs_handle_terminate all bricks getting detached need to
initiate a pmap_signout.

Change-Id: Iacbd6fcd49215fe6a5210df7dfed1260fde9179a
Fixes: bz#1570011
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
2018-05-04 04:49:52 +00:00
Thomas Hindoe Paaboel Andersen
af132df34c cli/snapshot: ignore errors for snapshot status for ALL/VOL
Currently errors are reported for snapshot status of type ALL and VOL.
The intention was to ignore those, but the code gets it wrong.

The original condition for ignoring ALL/VOL was removed in
   Bug 1096610
   Change-Id Ifc0ac31d2a9f91e136e87f3b51a629df7dba94e8

And the current logic introduced in
   Bug 789278
   Change-Id I985cea1ef787d239b2632d5a7f467070846f92e4

Change-Id: Ic02ea98fb23b1149264e91b41f2fc2ca916d405f
Fixes: bz#1574259
Signed-off-by: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
2018-05-04 04:49:43 +00:00
Susant Palai
c63b278947 cli/glusterd: Add warning message in cli for user to check
force-migration config for remove-brick operation.

The cli will take input from the user before starting "remove-brick"
start operation. The message/confirmation looks like the following:

<Running remove-brick with cluster.force-migration enabled can result
in data corruption. It is safer to disable this option so that files
that receive writes during migration are not migrated. Files that are
not migrated can then be manually copied after the remove-brick commit
operation. Do you want to continue with your current
cluster.force-migration settings? (y/n)>

And also question for COMMIT_FORCE is changed.

Fixes: bz#1572586
Change-Id: Ifdb6b108a646f50339dd196d6e65962864635139
Signed-off-by: Susant Palai <spalai@redhat.com>
2018-05-03 17:57:33 +00:00
Mohit Agrawal
f46047ea0f posix: Avoid changelog retries for geo-rep
Problem: georep is slowdown to migrate directory
         from master volume to slave volume due to lot
         of changelog retries

Solution: Update the condition in posix_getxattr to
          ignore MDS_INTERNAL_XATTR as it(posix) ignored
          other internal xattrs

BUG: 1571069
Change-Id: I4d91ec73e5b1ca1cb3ecf0825ab9f49e261da70e
fixes: bz#1571069
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
2018-05-03 15:42:54 +00:00
Ji-Hyeon Gim
47d2f7296b doc: updates Language Bindings for libgfapi-perl and gogfapi
The libgfapi-perl provides declarations and linkage for the Gluster
gfapi C library with FFI for many Perl mongers

In addition, gogfapi URI link is replaced with GitHub because Forge is
dead.

Change-Id: I773e78beb201b48ca3fde0dc72d04b64dc9697d6
Signed-off-by: Ji-Hyeon Gim <potatogim@potatogim.net>
Updates: #447
2018-05-03 15:28:15 +00:00
Niklas Hambüchen
cfa4ff1417 Don't use hardcoded /sbin, /usr/bin etc. paths. Fixes #1450546
Instead, rely on programs to be in PATH, as gluster already
does in many places across its code base.

Change-Id: Id21152fe42f5b67205d8f1571b0656c4d5f74246
BUG: 1450546
Signed-off-by: Niklas Hambuechen <mail@nh2.me>
2018-05-03 11:47:03 +00:00
Raghavendra G
86a0a7e562 cluster/dht: unwind if dht_selfheal_dir_mkdir returns an error
If dht_selfheal_dir_mkdir returns an error, cbk passed to
dht_selfheal_directory is not invoked. So, Current codepath leaves an
unwound frame resulting in a hung fop forever.

Change-Id: I422308b8a34a074301ca46b029ffe676f5e0f66c
fixes: bz#1574305
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
2018-05-03 11:00:12 +00:00