[-]
[+]
|
Changed |
glusterfs.spec
|
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/ChangeLog
^
|
@@ -1,9 +1,1042 @@
diff --git a/ChangeLog b/ChangeLog
-index 3b1c493..1e98d44 100644
+index 3b1c493..8a51840 100644
--- a/ChangeLog
+++ b/ChangeLog
-@@ -1 +1,81537 @@
+@@ -1 +1,82570 @@
-ChangeLog is maintained by "git log".
++commit ceaba0fc43efacdb5ef151b5334ad3239806e40c
++Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
++Date: Thu Oct 30 11:48:16 2014 -0400
++
++ doc: release notes for 3.4.6 GA
++
++ Change-Id: I4981af8e82606ac0dea1560b3d0497d5a2a48ec1
++ BUG: 1125245
++ Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
++ Reviewed-on: http://review.gluster.org/9015
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++
++commit 049580f209a1f2bed538d8c3f6953e3789d616f7
++Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
++Date: Thu Oct 30 10:13:36 2014 -0400
++
++ logrotate: gluster logrotate config should not be global
++
++ Issue : Previously glusterfs logrotate config file pollutes
++ global config. So moved the directives inside the curly braces,
++ so they don't pollute the global config state.
++
++ Backport of fix from BZ 1126801, http://review.gluster.org/#/c/9001/
++
++ Change-Id: Iafaa6bb295b7dd7554c2654716cc9aeafd6d7a68
++ BUG: 1158923
++ Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
++ Reviewed-on: http://review.gluster.org/9013
++ Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com>
++ Reviewed-by: Justin Clift <justin@gluster.org>
++
++commit dc8a3490e437d25ac2ee94a74778cd16c778514d
++Author: Pranith Kumar K <pkarampu@redhat.com>
++Date: Mon Sep 15 14:22:44 2014 +0530
++
++ cluster/afr: Handle EAGAIN properly in inodelk
++
++ Backport of http://review.gluster.org/8739
++
++ Problem:
++ When one of the brick is taken down and brough back up in a replica pair, locks
++ on that brick will be allowed. Afr returns inodelk success even when one of the
++ bricks already has the lock taken.
++
++ Fix:
++ If any brick returns EAGAIN return failure to parent xlator.
++
++ Note: This change only works for non-blocking inodelks. This patch addresses
++ dht-synchronization which uses non-blocking locks for rename. Blocking lock is
++ issued by only one of the rebalance processes. So for now there is no
++ possibility of deadlock.
++
++ BUG: 1151308
++ Change-Id: I72f15d8789442c29b5c7be2d5dabf7bae6bfa845
++ Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
++ Reviewed-on: http://review.gluster.org/8923
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Niels de Vos <ndevos@redhat.com>
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit 4dc4325a4c643b25fa7b670a30cf253491740d97
++Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
++Date: Wed Oct 22 10:25:29 2014 -0400
++
++ socket: disallow CBC cipher modes
++
++ This is related to CVE-2014-3566 a.k.a. POODLE.
++
++ http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-3566
++
++ POODLE is specific to CBC cipher modes in SSLv3. Because there is no
++ way to prevent SSLv3 fallback on a system with an unpatched version of
++ OpenSSL, users of such systems can only be protected by disallowing CBC
++ modes. The default cipher-mode specification in our code has been
++ changed accordingly.
++
++ cherry picked from http://review.gluster.org/#/c/8962/
++ BZ 1155328
++
++ Change-Id: Id38a7eb3ab55058a0ee5dda9cb4c62b49b1ab9cb
++ BUG: 1155630
++ Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
++ Reviewed-on: http://review.gluster.org/8967
++ Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
++
++commit fe3e541ac559c975f7b27cb07834c572db1c4465
++Author: Nithya Balachandran <nbalacha@redhat.com>
++Date: Wed Sep 3 10:42:47 2014 +0530
++
++ Cluster/DHT: Changing rename log severity
++
++ Changing log level for a rename message from debug
++ to info to improve debuggability
++
++ Change-Id: I53031fcf97fffd62095692477330ecde0cf47dcd
++ BUG: 1139998
++ Signed-off-by: Nithya Balachandran <nbalacha@redhat.com>
++ Reviewed-on: http://review.gluster.org/8582
++ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-on: http://review.gluster.org/8685
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit 3ade63522322d3c09b603a802eb1058cf4d0b50d
++Author: Shyam <srangana@redhat.com>
++Date: Wed Sep 10 09:55:11 2014 +0530
++
++ cluster/dht: Rename should not fail post hardlink creation
++
++ In the rename path, we wind the creation of newname hardlink and
++ linkto file in dst hashed a the same time. If the linkto creation
++ fails, but the link creation succeeds, we enter the failure code
++ and cleanup the created newname hardlink.
++
++ In the interim if another client looks up newname and finds it as
++ a hardlink from FUSE, it could send an unlink for oldname instead
++ of a rename. This combined with the above cleanup code could end
++ up losing all the files copies, and thereby losing data.
++
++ This fix separates these steps into 2 parts, creating the linkto
++ first and then the link file, so that post link file creation no
++ failures would cleanup the newname file. If linkto fails then link
++ is not attempted, thereby not polluting the name space with
++ newname.
++
++ Change-Id: I61da8e906060da16a31ea1076eec2f01fd617f44
++ BUG: 1139998
++ Signed-off-by: Shyam <srangana@redhat.com>
++ Reviewed-on: http://review.gluster.org/8570
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
++ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
++ Reviewed-on: http://review.gluster.org/8683
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit 49c4106fc338ebfeef15d4800cb8c17e575d8d3e
++Author: Shyam <srangana@redhat.com>
++Date: Wed Sep 10 09:23:15 2014 +0530
++
++ cluster/dht: Treat linkto file rename failure as non-critial error
++
++ It is a critical failure iff we fail to rename the cached file
++ if the rename of the linkto failed, it is not a critical failure,
++ and we do not want to lose the created hard link for the new
++ name as that could have been read by other clients.
++
++ NOTE: If another client is attempting the same oldname -> newname
++ rename, and finds both file names as existing, and are hard links
++ to each other, then FUSE would send in an unlink for oldname. In
++ this time duration if we treat the linkto as a critical error and
++ unlink the newname we created, we would have effectively lost the
++ file to rename operations.
++
++ Repercussions of treating this as a non-critical error is that
++ we could leave behind a stale linkto file and/or not create the new
++ linkto file, the second case would be rectified by a subsequent
++ lookup, the first case by a rebalance, like for all stale linkto
++ files
++
++ Change-Id: Ia53ad8b43c3cf8f48ef5b43fd1fec4274e807556
++ BUG: 1139998
++ Signed-off-by: Shyam <srangana@redhat.com>
++ Reviewed-on: http://review.gluster.org/8563
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
++ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
++ Reviewed-on: http://review.gluster.org/8682
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit c527449c0504828378f33ed32d1e7fe2e2c51c6f
++Author: Raghavendra G <rgowdapp@redhat.com>
++Date: Wed Sep 10 09:05:22 2014 +0530
++
++ cluster/dht: synchronize rename and file-migration
++
++ Change-Id: I4f243c946f76d440680b651235f925e3d0ebf0fd
++ Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
++ Reviewed-on: http://review.gluster.org/8523
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
++ BUG: 1139998
++ Reviewed-on: http://review.gluster.org/8681
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit 0ebe35ead483071ac3ff4b5c3802f40b1c719c8e
++Author: Raghavendra G <rgowdapp@redhat.com>
++Date: Thu Aug 14 16:44:23 2014 +0530
++
++ libglusterfs/syncop: implement inodelk
++
++ Change-Id: Iea489157490b70cb2bb03576b0d4943c6d8f052d
++ BUG: 1139998
++ Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
++ Reviewed-on: http://review.gluster.org/8522
++ Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
++ Reviewed-on: http://review.gluster.org/8680
++ Reviewed-by: N Balachandran <nbalacha@redhat.com>
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit fcd256faa951f459e344ced46f0cc409a5bbc147
++Author: Raghavendra G <rgowdapp@redhat.com>
++Date: Mon Aug 11 10:14:18 2014 +0530
++
++ cluster/dht: introduce locking api.
++
++ Change-Id: I41389ba91951d3e63e617aa32cd0bee848261c72
++ BUG: 1139998
++ Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
++ Reviewed-on: http://review.gluster.org/8521
++ Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
++ Reviewed-on: http://review.gluster.org/8679
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit 7a1e42e0d4be42fa8aa0c7a430b4fbc3ab509705
++Author: Shyam <srangana@redhat.com>
++Date: Tue Aug 12 10:48:27 2014 -0400
++
++ cluster/dht: Fix dht_access treating directory like files
++
++ When the cluster topology changes due to add-brick, all sub
++ volumes of DHT will not contain the directories till a rebalance
++ is completed. Till the rebalance is run, if a caller bypasses
++ lookup and calls access due to saved/cached inode information
++ (like NFS server does) then, dht_access misreads the error
++ (ESTALE/ENOENT) from the new subvolumes and incorrectly tries
++ to handle the inode as a file. This results in the directories
++ in memory state in DHT to be corrupted and not heal even post
++ a rebalance.
++
++ This commit fixes the problem in dht_access thereby preventing
++ DHT from misrepresenting a directory as a file in the case
++ presented above.
++
++ Change-Id: Idcdaa3837db71c8fe0a40ec0084a6c3dbe27e772
++ BUG: 1139997
++ Signed-off-by: Shyam <srangana@redhat.com>
++ Reviewed-on: http://review.gluster.org/8462
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
++ Reviewed-on: http://review.gluster.org/8678
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit 91175b38c9264676d75a275c16add45f7c64f4c1
++Author: shishir gowda <sgowda@redhat.com>
++Date: Thu Jul 11 13:44:51 2013 +0530
++
++ cluster/dht: Prevent dht_access from going into a loop.
++
++ If access fails with ENOTCONN, do not wind to same subvol.
++ We wind to first-up-subvol if access fails with ENOTCONN.
++ In few cases, if dht has only 1 subvolume, and access fails with
++ ENOTCONN, we go into a infinite loop of winding to same subvol
++
++ The fix is to check if we previously wound to same subvol, and
++ fail if first-up-subvol is same.
++
++ Change-Id: Ib5d3ce7d33e8ea09147905a7df1ed280874fa549
++ BUG: 1139996
++ Signed-off-by: shishir gowda <sgowda@redhat.com>
++ Reviewed-on: http://review.gluster.org/5319
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Anand Avati <avati@redhat.com>
++ Reviewed-on: http://review.gluster.org/8677
++ Reviewed-by: N Balachandran <nbalacha@redhat.com>
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit ebdb73daa1c4553b263b208afd22a299e6b7b233
++Author: Nithya Balachandran <nbalacha@redhat.com>
++Date: Mon Jul 21 18:46:14 2014 +0530
++
++ dht: fix rename race
++
++ Additional check to check if we created the linkto
++ file before deleting it in the rename cleanup function
++
++ Change-Id: I919cd7cb24f948ba4917eb9cf50d5169bb730a67
++ BUG: 1139988
++ Signed-off-by: Nithya Balachandran <nbalacha@redhat.com>
++ Reviewed-on: http://review.gluster.org/8338
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
++ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
++ Reviewed-on: http://review.gluster.org/8676
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit fe5cf303121215be6f00b4da0796fbf83922ec36
++Author: Raghavendra G <rgowdapp@redhat.com>
++Date: Fri Sep 5 12:05:15 2014 +0530
++
++ storage/posix: removing deleting entries in case of creation failures
++
++ The code is not atomic enough to not to delete a dentry created by a
++ prallel dentry creation operation.
++
++ Change-Id: I9bd6d2aa9e7a1c0688c0a937b02a4b4f56d7aa3d
++ BUG: 1139988
++ Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
++ Reviewed-on: http://review.gluster.org/8327
++ Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
++ Reviewed-on: http://review.gluster.org/8675
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit b3387c83a0d968db7428920f46434f09f4922e53
++Author: Venkatesh Somyajulu <vsomyaju@redhat.com>
++Date: Thu Sep 25 17:24:09 2014 +0530
++
++ cluster/dht: Fix races to avoid deletion of linkto
++ file
++
++ Explanation of Race between rebalance processes:
++ https://bugzilla.redhat.com/show_bug.cgi?id=1110694#c4
++
++ scenario-1:
++ ===========
++
++ STATE 1: BRICK-1
++ only one brick Cached File
++ in the system
++
++ STATE 2:
++ Add brick-2 BRICK-1 BRICK-2
++
++ STATE 3: Lookup of File on brick-2
++ by this node's rebalance
++ will fail because hashed
++ file is not created yet.
++ So dht_lookup_everywhere is
++ about to get called.
++
++ STATE 4: As part of lookup
++ link file at brick-2
++ will be created.
++
++ STATE 5: getxattr to check that
++ cached file belongs to
++ this node is done
++
++ STATE 6:
++
++ dht_lookup_everywhere_cbk detects
++ the link created by rebalance-1.
++ It will unlink it.
++
++ STATE 7: getxattr at the link
++ file with "pathinfo" key
++ will be called will fail
++ as the link file is deleted
++ by rebalance on node-2
++
++ Fix:
++ So in the STATE 6, we should avoid the deletion of link file. Every time
++ dht_lookup_everywhere gets called, lookup will be performed on all the nodes.
++ So to avoid STATE 6, if linkto file is found, it is not deleted until valid
++ case is found in dht_lookup_everywhere_done.
++
++ Case 1: if linkto file points to cached node, and cached file exists,
++ uwind with success.
++
++ Case 2: if linkto does not point to current cached node, and cached file
++ exists:
++ a) Unlink stale link file
++ b) Create new link file
++
++ Case 3: Only linkto file exists:
++ Delete linkto file
++
++ Case 4: Only cached file
++ Create link file (Handled event without patch)
++
++ Case 5: Neither cached nor hashed file is present
++ Return with ENOENT (handled even without patch)
++
++ Reviewed-on: http://review.gluster.org/8231
++
++ ******************************************************************************
++
++ scenario-2:
++ ===========
++ cluster/dht: Modified logic of linkto file deletion on non-hashed
++
++ Currently whenever dht_lookup_everywhere gets called, if in
++ dht_lookup_everywhere_cbk, a linkto file is found on non-hashed
++ subvolume, file is unlinked. But there are cases when this file
++ is under migration. Under such condition, we should avoid deletion
++ of file.
++
++ When some other rebalance process changes the layout of parent
++ such that dst_file (w.r.t. migration) falls on non-hashed node,
++ then may be lookup could have found it as linkto file but just
++ before unlink, file is under migration or already migrated
++ In such cased unlink can be avoided.
++
++ Race:
++ -------
++ If we have two bricks (brick-1 and brick-2) with initial file "a"
++ under BaseDir which is hashed as well as cached on (brick-1).
++
++ Assume "a" hashing gives 44.
++
++ Brick-1 Brick-2
++
++ Initial Setup: BaseDir/a BaseDir
++ [1-50] [51-100]
++
++ Now add new-brick Brick-3.
++
++ 1. Rebalance-1 on node Node-1 (Brick-1 node) will reset
++ the BaseDir Layout.
++
++ 2. After that it will perform
++ a) Create linkto file on new-hashed (brick-2)
++ b) Perform file migration.
++
++ 1.Rebalance-1 Fixes the base-layout:
++ Brick-1 Brick-2 Brick-3
++ --------- ---------- ------------
++ BaseDir/a BaseDir BaseDir
++ [1-33] [34-66] [67-100]
++
++ 2. Only a) is BaseDir/a BaseDir/a(linkto) BaseDir
++ performed Create linktofile
++
++ Now rebalance 2 on node-2 jumped in and it will perform
++ step 1 and 2-a.
++
++ After (rebal-2, step-1), it changes the layout of the BaseDir.
++ BaseDir/a BaseDir/a(link) BaseDir
++ [67-100] [1-33] [34-66]
++
++ For (rebale-2, step-2), It will perform lookup at Brick-3 as w.r.t new
++ layout 44 falls for brick-3. But lookup will fail.
++ So dht_lookup_everywhere gets called.
++
++ NOTE: On brick-2 by rebalance-1, a linkto file was created.
++
++ Currently that linkto files gets deleted by rebalance-2 lookup as it
++ is considered as stale linkto file. But with patch if rebalance is
++ already in progress or rebalance is over, linkto file will not be
++ unlinked. If rebalance is in progress fd will be open and if rebalance
++ is over then linkto file wont be set.
++
++ Reviewed-on: http://review.gluster.org/8345
++
++ *******************************************************************************
++
++ scenario-3:
++ ===========
++
++ cluster/dht: Added keys in dht_lookup_everywhere_done
++
++ Case where both cached (C1) and hashed file are found,
++ but hash does not point to above cached node (C1), then
++ dont unlink if either fd-is-open on hashed or
++ linkto-xattr is not found.
++
++ Reviewed-on: http://review.gluster.org/8429
++ BUG: 1139995
++ Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com>
++ Change-Id: I86d0a21d4c0501c45d837101ced4f96d6fedc5b9
++ Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com>
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: susant palai <spalai@redhat.com>
++ Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
++ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
++ Reviewed-on: http://review.gluster.org/8674
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit 3042613687d976c4e8938fb411cedc6e6ef559bf
++Author: Susant Palai <spalai@redhat.com>
++Date: Wed Jul 9 09:31:45 2014 -0400
++
++ DHT/Create : Failing to identify a linkto file in lookup_everywhere_cbk path
++
++ In case a file is not found in its cached subvol we proceed with
++ dht_lookup_everywhere. But as we dont add the linkto xattr to the
++ dictionary, we fail to identify any linkto file encountered.The
++ implication being we end up thinking the linkto file as a regular file
++ and proceed with the fop.
++
++ Change-Id: Iab02dc60e84bb1aeab49182f680c0631c33947e2
++ BUG: 1139992
++ Signed-off-by: Susant Palai <spalai@redhat.com>
++ Reviewed-on: http://review.gluster.org/8277
++ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-on: http://review.gluster.org/8673
++ Reviewed-by: N Balachandran <nbalacha@redhat.com>
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit a7356806f9f7c148d4e0a972f6a418d1ca82bcd0
++Author: Jeff Darcy <jdarcy@redhat.com>
++Date: Tue Jul 8 21:56:04 2014 -0400
++
++ dht: fix rename race
++
++ If two clients try to rename the same file at the same time, we
++ sometimes end up with *no file at all* in either the old or new
++ location. That's kind of bad. The culprit seems to be some overly
++ aggressive cleanup code. AFAICT, based on today's study of the code,
++ the intent of the changed section is to remove any linkfile we might
++ have created before the actual rename. However, what we're removing
++ might not be our extra link. If we're racing with another client that's
++ also doing a rename, it might be the only remaining link to the user's
++ data. The solution, which is good enough to pass this test but almost
++ certainly still not complete, is to be more selective about when we do
++ this unlink. Now, we only do it if we know that, at some point, we did
++ in fact create the link without error (notably ENOENT on the source or
++ EEXIST on the destination) ourselves.
++
++ Change-Id: I8d8cce150b6f8b372c9fb813c90be58d69f8eb7b
++ BUG: 1139988
++ Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
++ Reviewed-on: http://review.gluster.org/8269
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
++ Reviewed-on: http://review.gluster.org/8672
++ Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit bc75418e1e8eacb1978bdf7f7154d49895ffd544
++Author: Susant Palai <spalai@redhat.com>
++Date: Tue May 13 12:56:17 2014 -0400
++
++ DHT/readdirp: Directory not shown/healed on mount point if exists on single brick(non first up subvolume).
++
++ Problem: If snapshot is taken, when mkdir has succeeded only on
++ hashed_subvolume, then after restoring snapshot the directory
++ is not shown on mount point.
++
++ Why: dht_readdirp takes only those directory entries in to
++ account, which are present on first_up_subvolume. Hence, if the
++ "hashed subvolume" is not same as first_up_subvolume, it wont be listed
++ on mount point and also not healed.
++
++ Solution:
++ Case 1: (Rebalance not running)If hashed subvolume is NULL or down then
++ filter in first_up_subvolume. Other wise the corresponding hashed subvolume
++ will take care of the directory entry.
++
++ Case 2: If readdirp_optimize option is turned on then read from first_up_subvol
++
++ Change-Id: Idaad28f1c9f688dbfb1a8a3ab8b244510c02365e
++ BUG: 1139986
++ Signed-off-by: Susant Palai <spalai@redhat.com>
++ Reviewed-on: http://review.gluster.org/7599
++ Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
++ Reviewed-on: http://review.gluster.org/8671
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++ Tested-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit 67ccd153a889d81d4cd89534dbce792c111ad1c6
++Author: Venkatesh Somyajulu <vsomyaju@redhat.com>
++Date: Thu Jun 12 14:18:05 2014 +0530
++
++ dht/rebalance: Do not allow rebalance when gfid mismatch found
++
++ Due to race condition, it may so happen that, gfid obtained
++ in readdirp and gfid found by lookup are different for a given
++ name. in that case do no allow the rebalance.
++
++ Readdirp of an entry will bring the gfid, which will be stored
++ in the inode through inode_link, and when lookup is done and
++ gfid brought by lookup is different from the one stored in the
++ inode, client3_3_lookup_cbk will return ESATLE and error will be
++ captured by rebalance process.
++
++ Change-Id: Iad839177ef9b80c1dd0e87f3406bcf4cb018e6fa
++ BUG: 1139984
++ Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com>
++ Reviewed-on: http://review.gluster.org/7973
++ Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
++ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
++ Reviewed-on: http://review.gluster.org/8670
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit f8b5bfd5f329ce06dcd208beaf5c50c3a35f0a53
++Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
++Date: Thu Sep 25 11:56:08 2014 -0400
++
++ glusterfs.spec.in: add psmisc to -server subpackage
++
++ apparently some minimalist installs omit psmisc
++ needed for the killall in various %pre and %post scriptlets
++
++ smarter logic for restarting glusterd in %post server
++
++ Change-Id: I1581d278c2be6a917c20785437ce78c502111d8d
++ BUG: 1146624
++ Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
++ Reviewed-on: http://review.gluster.org/8859
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++
++commit ab0547eba39b155246f0d9f09e9a580665c6053f
++Author: Niels de Vos <ndevos@redhat.com>
++Date: Thu Sep 25 12:08:47 2014 +0200
++
++ socket: Fixed parsing RPC records containing multi fragments
++
++ In __socket_proto_state_machine(), when parsing RPC records containing
++ multi fragments, just change the state of parsing process, had not
++ processed the memory to coalesce the multi fragments.
++
++ Cherry picked from commit fb6702b7f8ba19333b7ba4af543d908e3f5e1923:
++ > Change-Id: I5583e578603bd7290814a5d26885b31759c73115
++ > BUG: 1139598
++ > Signed-off-by: Gu Feng <flygoast@126.com>
++ > Reviewed-on: http://review.gluster.org/8662
++ > Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ > Reviewed-by: Niels de Vos <ndevos@redhat.com>
++ > Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
++ > Tested-by: Raghavendra G <rgowdapp@redhat.com>
++
++ Change-Id: I5583e578603bd7290814a5d26885b31759c73115
++ BUG: 1146470
++ Signed-off-by: Niels de Vos <ndevos@redhat.com>
++ Reviewed-on: http://review.gluster.org/8849
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit e2a76e76e3d9174fa77f40f3abd0212705283f00
++Author: Krutika Dhananjay <kdhananj@redhat.com>
++Date: Thu Sep 18 14:36:38 2014 +0530
++
++ cluster/dht: Fix dict_t leaks in rebalance process' execution path
++
++ Backport of: http://review.gluster.org/8763
++
++ Two dict_t objects are leaked for every file migrated in success codepath.
++ It is the caller's responsibility to unref dict that it gets from calls to
++ syncop_getxattr(); and rebalance performs two syncop_getxattr()s per file
++ without freeing them.
++
++ Also, syncop_getxattr() on GF_XATTR_LINKINFO_KEY doesn't seem to be using
++ the response dict. Hence, NULL is now passed as opposed to @dict to
++ syncop_getxattr().
++
++ Change-Id: I59556ee6e135e7e65d4ddd31ba0f39e7eb50b02d
++ BUG: 1144792
++ Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
++ Reviewed-on: http://review.gluster.org/8789
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit c0b40b5bb1ff73131c743d74d3da16a28b2cbd28
++Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
++Date: Mon Sep 8 10:16:58 2014 -0400
++
++ gNFS: Fix memory leak in setacl code path
++
++ Backport of http://review.gluster.org/#/c/8651 (BZ # 1139195) to
++ release-3.4
++
++ If ACL is set on a file in Gluster NFS mount (setfacl command),
++ and it succeed, then the NFS call state data is leaked. Though
++ all the failure code path frees up the memory.
++
++ Impact: There is a OOM kill i.e. vdsm invoked oom-killer during
++ rebalance and Killed process 4305, UID 0, (glusterfs nfs process)
++
++ FIX:
++ Make sure to deallocate the memory for call state in acl3_setacl_cbk()
++ using nfs3_call_state_wipe();
++
++ Change-Id: I6664a9151e9417e114c858bb2cdb136d9cb0b283
++ BUG: 1139250
++ Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
++ Reviewed-on: http://review.gluster.org/8653
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
++ Reviewed-by: Niels de Vos <ndevos@redhat.com>
++
++commit 1d4ef0b891899e3a6dbc8c2087e73cee6f5a7fbe
++Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
++Date: Thu Aug 28 12:33:01 2014 -0400
++
++ mount/fuse: Handle fd resolution failures
++
++ Backport from http://review.gluster.org/#/c/8402, BZ 1126048
++
++ Problem:
++ Even when the fd resolution failed, the fop is continuing on the
++ new graph which may not have valid inode. This lead to NULL layout
++ subvols in dht which lead to crash in fsync after graph migration.
++
++ Fix:
++ - Remove resolution error handling in FUSE_FOP as it was only added
++ to handle fd migration failures.
++ - check in fuse_resolve_done for fd resolution failures and fail the
++ fop right away.
++ - loc resolution failures are already handled in the corresponding
++ fops.
++ - Return errno from state->resolve.op_errno in resume functions.
++ - Send error to fuse on frame allocation failures.
++ - Removed unused variable state->resolved
++ - Removed unused macro FUSE_FOP_COOKIE
++
++ Change-Id: I3f3129b9b4fc34ff1fe07218e6924a027346a95e
++ BUG: 1123289
++ Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
++ Reviewed-on: http://review.gluster.org/8562
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
++
++commit f0ddba7e0913db505f1295e9b3b7d35ead9c4407
++Author: Pranith Kumar K <pkarampu@redhat.com>
++Date: Tue Aug 26 12:59:47 2014 +0530
++
++ cluster/afr: Fix memory leak of file-path in self-heal-daemon
++
++ Backport of http://review.gluster.org/4790
++
++ Note: Only the part which fixes the memory leak is backported
++
++ shd event has path which needs to be freed as part of circular buffer cleanup.
++ This patch introduces the functionality so that self-heal-daemon can use it.
++
++ Change-Id: I3f3823d5587eda2fcb278f0fdb89123a31c9d786
++ BUG: 1119894
++ Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
++ Reviewed-on: http://review.gluster.org/8541
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Ravishankar N <ravishankar@redhat.com>
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit 1679b72c5b023884fb4bc6a2a85b06016fb3cab8
++Author: Niels de Vos <ndevos@redhat.com>
++Date: Thu Aug 21 18:24:33 2014 +0200
++
++ NFS: stripe-xlator should pass EOF at end of READDIR
++
++ NFS READDIR replies are made of a header, a sequence of
++ entries, and a EOF flag. When GlusterFS's NFS server is
++ used along with stripe xlator, it fails to set the EOF
++ flag, which violates NFS RFC and confuses some clients.
++
++ The bug is caused because nfs xlator sets EOF if it gets
++ op_errno set to ENOENT. That value is produced in storage
++ xlator and propagated through server, client, and other
++ xlators until stripe xlator handles it. stripe only passed
++ op_errno if op_ret < 0, which is not the case here. This
++ change set adds a special case for that situation to fix
++ the problem.
++
++ Cherry picked from commit 9b5231e5c98b8cfa116838287c7a14042702795f:
++ > Change-Id: Ie6db94b0515292387cfb04c1e4a9363f34fcd19a
++ > BUG: 1130969
++ > Reported-by: Emmanuel Dreyfus <manu@netbsd.org>
++ > Signed-off-by: Niels de Vos <ndevos@redhat.com>
++ > Reviewed-on: http://review.gluster.org/8493
++ > Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ > Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
++ > Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++ > Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org>
++ > Tested-by: Emmanuel Dreyfus <manu@netbsd.org>
++
++ Change-Id: Ie6db94b0515292387cfb04c1e4a9363f34fcd19a
++ BUG: 1132392
++ Signed-off-by: Niels de Vos <ndevos@redhat.com>
++ Reviewed-on: http://review.gluster.org/8510
++ Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++
++commit 7b564b88003aaef9d679ed0983e51f03dfd6d2f4
++Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
++Date: Wed Jul 23 12:57:24 2014 -0400
++
++ doc/release-nodes: release notes for 3.4.5 GA
++
++ Change-Id: I359c280b67006473a836c90771b28598fe712c80
++ BUG: 1110456
++ Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
++ Reviewed-on: http://review.gluster.org/8370
++
++commit e311014d94c7fcfd8c5e7abe3aca7d99f43e0d91
++Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
++Date: Tue Jul 8 08:25:36 2014 -0400
++
++ nfs: prevent assertion error with MOUNT over UDP
++
++ see http://review.gluster.org/#/c/8258/, http://review.gluster.org/8241;
++ and BZs 1116997, 1116503, respectively.
++
++ The MOUNT service over UDP runs in a separate thread. This thread does
++ not have the correct *THIS xlator set. *THIS points to the global (base)
++ xlator structure, but GF_CALLOC() requires it to be the NFS-xlator so
++ that assertions can get validated correctly.
++
++ This is solved by passing the NFS-xlator to the pthread function, and
++ setting the *THIS pointer explicitly in the new thread.
++
++ It seems that on occasion (needs further investigation) MOUNT over UDP
++ does not unregister itself. There can also be issues when the kernel NLM
++ implementation has been registered at portmap/rpcbind, so adding some
++ unregister procedures in the cleanup of the test-cases.
++
++ Change-Id: Iea3bafd65bf480f2b12da91875c73571594d52d3
++ BUG: 1117256
++ Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
++ Reviewed-on: http://review.gluster.org/8262
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Niels de Vos <ndevos@redhat.com>
++ Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
++
++commit b3bf2cfaa8e932f02a10a42e0281290a7cbdc960
++Author: Vijay Bellur <vbellur@redhat.com>
++Date: Sat Jul 5 21:19:01 2014 +0530
++
++ performance/quick-read: Check for iobuf and iobref before unref.
++
++ In the absence of this check, iobuf_unref() can cause a log flood
++ for read operations.
++
++ Change-Id: Ib8beef6e55b69ecfb566bf61a96215ef0d0d74dc
++ BUG: 1116514
++ Signed-off-by: Vijay Bellur <vbellur@redhat.com>
++ Reviewed-on: http://review.gluster.org/8242
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
++ Reviewed-by: Prashanth Pai <ppai@redhat.com>
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit ecc21940eaa44a38618e8d1d9c9690fffbd5ac72
++Author: Justin Clift <justin@gluster.org>
++Date: Tue Jun 24 20:57:02 2014 +0100
++
++ fuse: fix memory leak in fuse_getxattr()
++
++ The fuse_getxattr() function was not freeing fuse_state_t resulting in a
++ memory leak. As a result, when continuous writes (run dd command in a loop)
++ were done from a FUSE mount point, the OOM killer killed the client
++ process (glusterfs).
++
++ Manual backport of: http://review.gluster.org/#/c/5392/, provided
++ by Martin Svec <martin.svec@zoner.cz>.
++
++ BUG: 1112844
++ Change-Id: Ic723675c53384d48c79ad1b11b21c1b17fb56866
++ Reviewed-on: http://review.gluster.org/8164
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Ravishankar N <ravishankar@redhat.com>
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit 33b61346caee59391cd1681623cdac85cbfc04f6
++Author: Joe Julian <me@joejulian.name>
++Date: Thu May 22 10:41:21 2014 -0700
++
++ doc: Fix peer probe deficiencies
++
++ Added the command to probe the first server to assign it a hostname
++
++ Change-Id: I67f35553df74718f23cd8453dc7854a44c61be11
++ BUG: 1095596
++ Reviewed-on: http://review.gluster.org/7854
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit 2b789331dc933b186360fc8cbffb06289ee60ee9
++Author: Vijay Bellur <vbellur@redhat.com>
++Date: Tue Jun 10 22:21:28 2014 +0530
++
++ cluster/dht: Don't do extra unref in dht-migration checks
++
++ Problem:
++ syncop_open used to perform a ref in syncop_open_cbk so the extra
++ unref was needed but now syncop_open_cbk does not take a ref so no
++ need to do extra unref.
++
++ Fix:
++ remove the extra fd_unref and let dht_local_wipe do the final unref.
++
++ Change-Id: Ibe8f9a678d456a0c7bff175306068b5cd297ecc4
++ BUG: 961615
++ Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
++ Signed-off-by: Vijay Bellur <vbellur@redhat.com>
++ Reviewed-on: http://review.gluster.org/8029
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Tested-by: Joe Julian <joe@julianfamily.org>
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
++commit 8005d56f080a27f2f408a85f2bf28b3470668ece
++Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
++Date: Sun May 25 10:40:31 2014 -0400
++
++ release-notes: 3.4.4
++
++ Change-Id: I9553500016a6a56d1aaf7bc7f90249bed95fa1b1
++ BUG: 1095324
++ Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
++ Reviewed-on: http://review.gluster.org/7866
++
++commit d5e317718f4137431c3996ac5f38e9226620e760
++Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
++Date: Mon Apr 28 14:25:09 2014 -0400
++
++ core: fix Ubuntu code audit (cppcheck) results
++
++ These block inclusion in Ubuntu Main repo.
++
++ AFAICT these are false positives:
++
++ [rpc/rpc-transport/rdma/src/rdma.c:3074]: (error) Address of local auto-variable assigned to a function parameter.
++ [xlators/features/marker/utils/src/gsyncd.c:99]: (error) Memory leak: str
++ [xlators/features/marker/utils/src/gsyncd.c:354]: (error) Memory leak: argv
++ [xlators/nfs/server/src/nlm4.c:1176]: (error) Possible null pointer dereference: fde
++
++ The remainder are fixed with this change-set:
++
++ [api/src/glfs-fops.c:700]: (error) Possible null pointer dereference: gio
++ [api/src/glfs-fops.c:702]: (error) Possible null pointer dereference: frame
++ [xlators/cluster/afr/src/afr-inode-write.c:375]: (error) Possible null pointer dereference: frame
++ [xlators/cluster/afr/src/afr-self-heal-common.c:1522]: (error) Possible null pointer dereference: local
++ [xlators/cluster/dht/src/dht-rebalance.c:1574]: (error) Possible null pointer dereference: ctx
++ [xlators/cluster/stripe/src/stripe.c:4407]: (error) Possible null pointer dereference: local
++ [xlators/mgmt/glusterd/src/glusterd-mountbroker.c:675]: (error) Possible null pointer dereference: cookieswitch
++ [xlators/mgmt/glusterd/src/glusterd-mountbroker.c:677]: (error) Possible null pointer dereference: cookieswitch
++ [xlators/mgmt/glusterd/src/glusterd-replace-brick.c:924]: (error) Resource leak: file
++ [xlators/mgmt/glusterd/src/glusterd-replace-brick.c:1008]: (error) Resource leak: file
++ [xlators/mgmt/glusterd/src/glusterd-sm.c:248]: (error) Possible null pointer dereference: new_ev_ctx
++ [xlators/mgmt/glusterd/src/glusterd-store.c:1250]: (error) Possible null pointer dereference: handle
++ [xlators/mgmt/glusterd/src/glusterd-utils.c:4272]: (error) Possible null pointer dereference: this
++ [xlators/mgmt/glusterd/src/glusterd-utils.c:5113]: (error) Possible null pointer dereference: this
++ [xlators/mount/fuse/src/fuse-bridge.c:4432]: (error) Uninitialized variable: finh
++ [xlators/mount/fuse/src/fuse-bridge.c:2927]: (error) Possible null pointer dereference: state
++ [xlators/mount/fuse/src/fuse-bridge.c:3226]: (error) Possible null pointer dereference: state
++ [xlators/storage/bd_map/src/bd_map.c:1504]: (error) Possible null pointer dereference: bd_fd
++ [xlators/storage/bd_map/src/bd_map.c:1728]: (error) Possible null pointer dereference: n_entry
++ [xlators/storage/bd_map/src/bd_map.c:1741]: (error) Possible null pointer dereference: n_entry
++ [xlators/performance/quick-read/src/quick-read.c:585]: (error) Possible null pointer dereference: iobuf
++
++ rerunning cppcheck --force afterwards:
++
++ Test code, don't care:
++ [extras/test/test-ffop.c:27]: (error) Buffer overrun possible for long command line arguments.
++
++ False positive after fix
++ [xlators/cluster/stripe/src/stripe.c:4407]: (error) Possible null pointer dereference: local
++
++ Still false positive:
++ [xlators/features/marker/utils/src/gsyncd.c:354]: (error) Memory leak: argv
++ [xlators/nfs/server/src/nlm4.c:1176]: (error) Possible null pointer dereference: fde
++
++ Not built, don't care:
++ [xlators/cluster/ha/src/ha.c:2699]: (error) Possible null pointer dereference: priv
++
++ Change-Id: I1fb849e9c042d3a3701cb05121d413e58e73d505
++ BUG: 1086460
++ Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
++ Reviewed-on: http://review.gluster.org/7583
++ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++
++commit 4f8f96c62b21185f27d8e76912a808af80e22608
++Author: Xavier Hernandez <xhernandez@datalab.es>
++Date: Thu May 23 11:13:25 2013 +0200
++
++ storage/posix: do not dereference gfid symlinks before posix_handle_mkdir_hashes()
++
++ Whenever a new directory is created, its corresponding gfid file must
++ also be created. This was done first calling MAKE_HANDLE_PATH() to get
++ the path of the gfid file, then calling posix_handle_mkdir_hashes() to
++ create the parent directories of the gfid, and finally creating the
++ soft-link.
++
++ In normal circumstances, the gfid we want to create won't exist and
++ MAKE_HANDLE_PATH() will return a simple path to the new gfid. However if
++ the volume is damaged and a self-heal is running, it is possible that we
++ try to create an already existing gfid. In this case, MAKE_HANDLE_PATH()
++ will return a path to the directory instead of the path to the gfid.
++
++ To solve this problem, every time a path to a gfid is needed, a call to
++ MAKE_HANDLE_ABSPATH() is made instead of the call to MAKE_HANDLE_PATH().
++
++ BUG: 1099955
++ Change-Id: I5bcd2b3c38d172c75946f33519e057e76d960a24
++ Signed-off-by: Xavier Hernandez <xhernandez@datalab.es>
++ Reviewed-on: http://review.gluster.org/6737
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++
++commit 27482ac4678ce7df56126bb9accfebceab1d9fa8
++Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
++Date: Wed May 7 09:29:24 2014 -0400
++
++ nfs: exit when all volumes are disabled
++
++ Instead of triggering 4-5 error logs, when nfs is
++ disabled for all volumes, exit the process.
++
++ backport from 3.5
++
++ Change-Id: I191294232f5848a4a01609b477289d628cf89ba5
++ BUG: 1095330
++ Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
++ Reviewed-on: http://review.gluster.org/7699
++ Tested-by: Gluster Build System <jenkins@build.gluster.com>
++ Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
++ Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
++
++commit c1c7ae92a2b6bb7d57270fadd7a5d61c90fa3781
++Author: Rajesh Joseph <rjoseph@redhat.com>
++Date: Thu Aug 1 12:55:51 2013 +0530
++
++ nfs: Fix for NFS crash during blocking NLM call.
++
++ Bug 990887: During a blocking NLM call NFS server is crashing.
++
++ Cause: When nlm4_establish_callback function is called from nlm4svc_send_granted the cs->req->trans
++ pointer is NULL. Thus using this pointer will result in a crash. Whereas cs->trans points to a
++ valid transport object. NLM should use cs->trans instead of cs->req->trans.
++
++ Fix: Replaced cs->req->trans with cs->trans.
++
++ Backport of: http://review.gluster.org/#/c/5452/
++
++ BUG: 990887
++ Change-Id: I33d4b6634752333d6791b1a47ebf10c787c22120
++ Signed-off-by: Justin Clift <justin@gluster.org>
++ Reviewed-on: http://review.gluster.org/7478
++ Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
++ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
++
+commit b0d6d20ab23627861a2d228d2124dee5e2ab9771
+Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+Date: Wed Apr 2 14:25:33 2014 -0400
@@ -81542,7 +82575,7 @@
+
+ Initial import
diff --git a/configure.ac b/configure.ac
-index 10c8eb1..dc0cc4b 100644
+index 10c8eb1..3c550bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,7 +6,7 @@ dnl General Public License, version 3 or any later version (LGPLv3 or
@@ -81550,11 +82583,1044 @@
dnl cases as published by the Free Software Foundation.
-AC_INIT([glusterfs],[3.4git],[gluster-users@gluster.org],,[https://github.com/gluster/glusterfs.git])
-+AC_INIT([glusterfs],[3.4.3],[gluster-users@gluster.org])
++AC_INIT([glusterfs],[3.4.6],[gluster-users@gluster.org])
AM_INIT_AUTOMAKE
===== git log ====
+commit ceaba0fc43efacdb5ef151b5334ad3239806e40c
+Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+Date: Thu Oct 30 11:48:16 2014 -0400
+
+ doc: release notes for 3.4.6 GA
+
+ Change-Id: I4981af8e82606ac0dea1560b3d0497d5a2a48ec1
+ BUG: 1125245
+ Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+ Reviewed-on: http://review.gluster.org/9015
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+
+commit 049580f209a1f2bed538d8c3f6953e3789d616f7
+Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+Date: Thu Oct 30 10:13:36 2014 -0400
+
+ logrotate: gluster logrotate config should not be global
+
+ Issue : Previously glusterfs logrotate config file pollutes
+ global config. So moved the directives inside the curly braces,
+ so they don't pollute the global config state.
+
+ Backport of fix from BZ 1126801, http://review.gluster.org/#/c/9001/
+
+ Change-Id: Iafaa6bb295b7dd7554c2654716cc9aeafd6d7a68
+ BUG: 1158923
+ Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+ Reviewed-on: http://review.gluster.org/9013
+ Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com>
+ Reviewed-by: Justin Clift <justin@gluster.org>
+
+commit dc8a3490e437d25ac2ee94a74778cd16c778514d
+Author: Pranith Kumar K <pkarampu@redhat.com>
+Date: Mon Sep 15 14:22:44 2014 +0530
+
+ cluster/afr: Handle EAGAIN properly in inodelk
+
+ Backport of http://review.gluster.org/8739
+
+ Problem:
+ When one of the brick is taken down and brough back up in a replica pair, locks
+ on that brick will be allowed. Afr returns inodelk success even when one of the
+ bricks already has the lock taken.
+
+ Fix:
+ If any brick returns EAGAIN return failure to parent xlator.
+
+ Note: This change only works for non-blocking inodelks. This patch addresses
+ dht-synchronization which uses non-blocking locks for rename. Blocking lock is
+ issued by only one of the rebalance processes. So for now there is no
+ possibility of deadlock.
+
+ BUG: 1151308
+ Change-Id: I72f15d8789442c29b5c7be2d5dabf7bae6bfa845
+ Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
+ Reviewed-on: http://review.gluster.org/8923
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Niels de Vos <ndevos@redhat.com>
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit 4dc4325a4c643b25fa7b670a30cf253491740d97
+Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+Date: Wed Oct 22 10:25:29 2014 -0400
+
+ socket: disallow CBC cipher modes
+
+ This is related to CVE-2014-3566 a.k.a. POODLE.
+
+ http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-3566
+
+ POODLE is specific to CBC cipher modes in SSLv3. Because there is no
+ way to prevent SSLv3 fallback on a system with an unpatched version of
+ OpenSSL, users of such systems can only be protected by disallowing CBC
+ modes. The default cipher-mode specification in our code has been
+ changed accordingly.
+
+ cherry picked from http://review.gluster.org/#/c/8962/
+ BZ 1155328
+
+ Change-Id: Id38a7eb3ab55058a0ee5dda9cb4c62b49b1ab9cb
+ BUG: 1155630
+ Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+ Reviewed-on: http://review.gluster.org/8967
+ Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
+
+commit fe3e541ac559c975f7b27cb07834c572db1c4465
+Author: Nithya Balachandran <nbalacha@redhat.com>
+Date: Wed Sep 3 10:42:47 2014 +0530
+
+ Cluster/DHT: Changing rename log severity
+
+ Changing log level for a rename message from debug
+ to info to improve debuggability
+
+ Change-Id: I53031fcf97fffd62095692477330ecde0cf47dcd
+ BUG: 1139998
+ Signed-off-by: Nithya Balachandran <nbalacha@redhat.com>
+ Reviewed-on: http://review.gluster.org/8582
+ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-on: http://review.gluster.org/8685
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit 3ade63522322d3c09b603a802eb1058cf4d0b50d
+Author: Shyam <srangana@redhat.com>
+Date: Wed Sep 10 09:55:11 2014 +0530
+
+ cluster/dht: Rename should not fail post hardlink creation
+
+ In the rename path, we wind the creation of newname hardlink and
+ linkto file in dst hashed a the same time. If the linkto creation
+ fails, but the link creation succeeds, we enter the failure code
+ and cleanup the created newname hardlink.
+
+ In the interim if another client looks up newname and finds it as
+ a hardlink from FUSE, it could send an unlink for oldname instead
+ of a rename. This combined with the above cleanup code could end
+ up losing all the files copies, and thereby losing data.
+
+ This fix separates these steps into 2 parts, creating the linkto
+ first and then the link file, so that post link file creation no
+ failures would cleanup the newname file. If linkto fails then link
+ is not attempted, thereby not polluting the name space with
+ newname.
+
+ Change-Id: I61da8e906060da16a31ea1076eec2f01fd617f44
+ BUG: 1139998
+ Signed-off-by: Shyam <srangana@redhat.com>
+ Reviewed-on: http://review.gluster.org/8570
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
+ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
+ Reviewed-on: http://review.gluster.org/8683
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit 49c4106fc338ebfeef15d4800cb8c17e575d8d3e
+Author: Shyam <srangana@redhat.com>
+Date: Wed Sep 10 09:23:15 2014 +0530
+
+ cluster/dht: Treat linkto file rename failure as non-critial error
+
+ It is a critical failure iff we fail to rename the cached file
+ if the rename of the linkto failed, it is not a critical failure,
+ and we do not want to lose the created hard link for the new
+ name as that could have been read by other clients.
+
+ NOTE: If another client is attempting the same oldname -> newname
+ rename, and finds both file names as existing, and are hard links
+ to each other, then FUSE would send in an unlink for oldname. In
+ this time duration if we treat the linkto as a critical error and
+ unlink the newname we created, we would have effectively lost the
+ file to rename operations.
+
+ Repercussions of treating this as a non-critical error is that
+ we could leave behind a stale linkto file and/or not create the new
+ linkto file, the second case would be rectified by a subsequent
+ lookup, the first case by a rebalance, like for all stale linkto
+ files
+
+ Change-Id: Ia53ad8b43c3cf8f48ef5b43fd1fec4274e807556
+ BUG: 1139998
+ Signed-off-by: Shyam <srangana@redhat.com>
+ Reviewed-on: http://review.gluster.org/8563
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
+ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
+ Reviewed-on: http://review.gluster.org/8682
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit c527449c0504828378f33ed32d1e7fe2e2c51c6f
+Author: Raghavendra G <rgowdapp@redhat.com>
+Date: Wed Sep 10 09:05:22 2014 +0530
+
+ cluster/dht: synchronize rename and file-migration
+
+ Change-Id: I4f243c946f76d440680b651235f925e3d0ebf0fd
+ Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
+ Reviewed-on: http://review.gluster.org/8523
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
+ BUG: 1139998
+ Reviewed-on: http://review.gluster.org/8681
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit 0ebe35ead483071ac3ff4b5c3802f40b1c719c8e
+Author: Raghavendra G <rgowdapp@redhat.com>
+Date: Thu Aug 14 16:44:23 2014 +0530
+
+ libglusterfs/syncop: implement inodelk
+
+ Change-Id: Iea489157490b70cb2bb03576b0d4943c6d8f052d
+ BUG: 1139998
+ Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
+ Reviewed-on: http://review.gluster.org/8522
+ Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
+ Reviewed-on: http://review.gluster.org/8680
+ Reviewed-by: N Balachandran <nbalacha@redhat.com>
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit fcd256faa951f459e344ced46f0cc409a5bbc147
+Author: Raghavendra G <rgowdapp@redhat.com>
+Date: Mon Aug 11 10:14:18 2014 +0530
+
+ cluster/dht: introduce locking api.
+
+ Change-Id: I41389ba91951d3e63e617aa32cd0bee848261c72
+ BUG: 1139998
+ Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
+ Reviewed-on: http://review.gluster.org/8521
+ Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
+ Reviewed-on: http://review.gluster.org/8679
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit 7a1e42e0d4be42fa8aa0c7a430b4fbc3ab509705
+Author: Shyam <srangana@redhat.com>
+Date: Tue Aug 12 10:48:27 2014 -0400
+
+ cluster/dht: Fix dht_access treating directory like files
+
+ When the cluster topology changes due to add-brick, all sub
+ volumes of DHT will not contain the directories till a rebalance
+ is completed. Till the rebalance is run, if a caller bypasses
+ lookup and calls access due to saved/cached inode information
+ (like NFS server does) then, dht_access misreads the error
+ (ESTALE/ENOENT) from the new subvolumes and incorrectly tries
+ to handle the inode as a file. This results in the directories
+ in memory state in DHT to be corrupted and not heal even post
+ a rebalance.
+
+ This commit fixes the problem in dht_access thereby preventing
+ DHT from misrepresenting a directory as a file in the case
+ presented above.
+
+ Change-Id: Idcdaa3837db71c8fe0a40ec0084a6c3dbe27e772
+ BUG: 1139997
+ Signed-off-by: Shyam <srangana@redhat.com>
+ Reviewed-on: http://review.gluster.org/8462
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
+ Reviewed-on: http://review.gluster.org/8678
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit 91175b38c9264676d75a275c16add45f7c64f4c1
+Author: shishir gowda <sgowda@redhat.com>
+Date: Thu Jul 11 13:44:51 2013 +0530
+
+ cluster/dht: Prevent dht_access from going into a loop.
+
+ If access fails with ENOTCONN, do not wind to same subvol.
+ We wind to first-up-subvol if access fails with ENOTCONN.
+ In few cases, if dht has only 1 subvolume, and access fails with
+ ENOTCONN, we go into a infinite loop of winding to same subvol
+
+ The fix is to check if we previously wound to same subvol, and
+ fail if first-up-subvol is same.
+
+ Change-Id: Ib5d3ce7d33e8ea09147905a7df1ed280874fa549
+ BUG: 1139996
+ Signed-off-by: shishir gowda <sgowda@redhat.com>
+ Reviewed-on: http://review.gluster.org/5319
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Anand Avati <avati@redhat.com>
+ Reviewed-on: http://review.gluster.org/8677
+ Reviewed-by: N Balachandran <nbalacha@redhat.com>
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit ebdb73daa1c4553b263b208afd22a299e6b7b233
+Author: Nithya Balachandran <nbalacha@redhat.com>
+Date: Mon Jul 21 18:46:14 2014 +0530
+
+ dht: fix rename race
+
+ Additional check to check if we created the linkto
+ file before deleting it in the rename cleanup function
+
+ Change-Id: I919cd7cb24f948ba4917eb9cf50d5169bb730a67
+ BUG: 1139988
+ Signed-off-by: Nithya Balachandran <nbalacha@redhat.com>
+ Reviewed-on: http://review.gluster.org/8338
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
+ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
+ Reviewed-on: http://review.gluster.org/8676
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit fe5cf303121215be6f00b4da0796fbf83922ec36
+Author: Raghavendra G <rgowdapp@redhat.com>
+Date: Fri Sep 5 12:05:15 2014 +0530
+
+ storage/posix: removing deleting entries in case of creation failures
+
+ The code is not atomic enough to not to delete a dentry created by a
+ prallel dentry creation operation.
+
+ Change-Id: I9bd6d2aa9e7a1c0688c0a937b02a4b4f56d7aa3d
+ BUG: 1139988
+ Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
+ Reviewed-on: http://review.gluster.org/8327
+ Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
+ Reviewed-on: http://review.gluster.org/8675
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit b3387c83a0d968db7428920f46434f09f4922e53
+Author: Venkatesh Somyajulu <vsomyaju@redhat.com>
+Date: Thu Sep 25 17:24:09 2014 +0530
+
+ cluster/dht: Fix races to avoid deletion of linkto
+ file
+
+ Explanation of Race between rebalance processes:
+ https://bugzilla.redhat.com/show_bug.cgi?id=1110694#c4
+
+ scenario-1:
+ ===========
+
+ STATE 1: BRICK-1
+ only one brick Cached File
+ in the system
+
+ STATE 2:
+ Add brick-2 BRICK-1 BRICK-2
+
+ STATE 3: Lookup of File on brick-2
+ by this node's rebalance
+ will fail because hashed
+ file is not created yet.
+ So dht_lookup_everywhere is
+ about to get called.
+
+ STATE 4: As part of lookup
+ link file at brick-2
+ will be created.
+
+ STATE 5: getxattr to check that
+ cached file belongs to
+ this node is done
+
+ STATE 6:
+
+ dht_lookup_everywhere_cbk detects
+ the link created by rebalance-1.
+ It will unlink it.
+
+ STATE 7: getxattr at the link
+ file with "pathinfo" key
+ will be called will fail
+ as the link file is deleted
+ by rebalance on node-2
+
+ Fix:
+ So in the STATE 6, we should avoid the deletion of link file. Every time
+ dht_lookup_everywhere gets called, lookup will be performed on all the nodes.
+ So to avoid STATE 6, if linkto file is found, it is not deleted until valid
+ case is found in dht_lookup_everywhere_done.
+
+ Case 1: if linkto file points to cached node, and cached file exists,
+ uwind with success.
+
+ Case 2: if linkto does not point to current cached node, and cached file
+ exists:
+ a) Unlink stale link file
+ b) Create new link file
+
+ Case 3: Only linkto file exists:
+ Delete linkto file
+
+ Case 4: Only cached file
+ Create link file (Handled event without patch)
+
+ Case 5: Neither cached nor hashed file is present
+ Return with ENOENT (handled even without patch)
+
+ Reviewed-on: http://review.gluster.org/8231
+
+ ******************************************************************************
+
+ scenario-2:
+ ===========
+ cluster/dht: Modified logic of linkto file deletion on non-hashed
+
+ Currently whenever dht_lookup_everywhere gets called, if in
+ dht_lookup_everywhere_cbk, a linkto file is found on non-hashed
+ subvolume, file is unlinked. But there are cases when this file
+ is under migration. Under such condition, we should avoid deletion
+ of file.
+
+ When some other rebalance process changes the layout of parent
+ such that dst_file (w.r.t. migration) falls on non-hashed node,
+ then may be lookup could have found it as linkto file but just
+ before unlink, file is under migration or already migrated
+ In such cased unlink can be avoided.
+
+ Race:
+ -------
+ If we have two bricks (brick-1 and brick-2) with initial file "a"
+ under BaseDir which is hashed as well as cached on (brick-1).
+
+ Assume "a" hashing gives 44.
+
+ Brick-1 Brick-2
+
+ Initial Setup: BaseDir/a BaseDir
+ [1-50] [51-100]
+
+ Now add new-brick Brick-3.
+
+ 1. Rebalance-1 on node Node-1 (Brick-1 node) will reset
+ the BaseDir Layout.
+
+ 2. After that it will perform
+ a) Create linkto file on new-hashed (brick-2)
+ b) Perform file migration.
+
+ 1.Rebalance-1 Fixes the base-layout:
+ Brick-1 Brick-2 Brick-3
+ --------- ---------- ------------
+ BaseDir/a BaseDir BaseDir
+ [1-33] [34-66] [67-100]
+
+ 2. Only a) is BaseDir/a BaseDir/a(linkto) BaseDir
+ performed Create linktofile
+
+ Now rebalance 2 on node-2 jumped in and it will perform
+ step 1 and 2-a.
+
+ After (rebal-2, step-1), it changes the layout of the BaseDir.
+ BaseDir/a BaseDir/a(link) BaseDir
+ [67-100] [1-33] [34-66]
+
+ For (rebale-2, step-2), It will perform lookup at Brick-3 as w.r.t new
+ layout 44 falls for brick-3. But lookup will fail.
+ So dht_lookup_everywhere gets called.
+
+ NOTE: On brick-2 by rebalance-1, a linkto file was created.
+
+ Currently that linkto files gets deleted by rebalance-2 lookup as it
+ is considered as stale linkto file. But with patch if rebalance is
+ already in progress or rebalance is over, linkto file will not be
+ unlinked. If rebalance is in progress fd will be open and if rebalance
+ is over then linkto file wont be set.
+
+ Reviewed-on: http://review.gluster.org/8345
+
+ *******************************************************************************
+
+ scenario-3:
+ ===========
+
+ cluster/dht: Added keys in dht_lookup_everywhere_done
+
+ Case where both cached (C1) and hashed file are found,
+ but hash does not point to above cached node (C1), then
+ dont unlink if either fd-is-open on hashed or
+ linkto-xattr is not found.
+
+ Reviewed-on: http://review.gluster.org/8429
+ BUG: 1139995
+ Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com>
+ Change-Id: I86d0a21d4c0501c45d837101ced4f96d6fedc5b9
+ Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com>
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: susant palai <spalai@redhat.com>
+ Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
+ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
+ Reviewed-on: http://review.gluster.org/8674
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit 3042613687d976c4e8938fb411cedc6e6ef559bf
+Author: Susant Palai <spalai@redhat.com>
+Date: Wed Jul 9 09:31:45 2014 -0400
+
+ DHT/Create : Failing to identify a linkto file in lookup_everywhere_cbk path
+
+ In case a file is not found in its cached subvol we proceed with
+ dht_lookup_everywhere. But as we dont add the linkto xattr to the
+ dictionary, we fail to identify any linkto file encountered.The
+ implication being we end up thinking the linkto file as a regular file
+ and proceed with the fop.
+
+ Change-Id: Iab02dc60e84bb1aeab49182f680c0631c33947e2
+ BUG: 1139992
+ Signed-off-by: Susant Palai <spalai@redhat.com>
+ Reviewed-on: http://review.gluster.org/8277
+ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-on: http://review.gluster.org/8673
+ Reviewed-by: N Balachandran <nbalacha@redhat.com>
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit a7356806f9f7c148d4e0a972f6a418d1ca82bcd0
+Author: Jeff Darcy <jdarcy@redhat.com>
+Date: Tue Jul 8 21:56:04 2014 -0400
+
+ dht: fix rename race
+
+ If two clients try to rename the same file at the same time, we
+ sometimes end up with *no file at all* in either the old or new
+ location. That's kind of bad. The culprit seems to be some overly
+ aggressive cleanup code. AFAICT, based on today's study of the code,
+ the intent of the changed section is to remove any linkfile we might
+ have created before the actual rename. However, what we're removing
+ might not be our extra link. If we're racing with another client that's
+ also doing a rename, it might be the only remaining link to the user's
+ data. The solution, which is good enough to pass this test but almost
+ certainly still not complete, is to be more selective about when we do
+ this unlink. Now, we only do it if we know that, at some point, we did
+ in fact create the link without error (notably ENOENT on the source or
+ EEXIST on the destination) ourselves.
+
+ Change-Id: I8d8cce150b6f8b372c9fb813c90be58d69f8eb7b
+ BUG: 1139988
+ Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
+ Reviewed-on: http://review.gluster.org/8269
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
+ Reviewed-on: http://review.gluster.org/8672
+ Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit bc75418e1e8eacb1978bdf7f7154d49895ffd544
+Author: Susant Palai <spalai@redhat.com>
+Date: Tue May 13 12:56:17 2014 -0400
+
+ DHT/readdirp: Directory not shown/healed on mount point if exists on single brick(non first up subvolume).
+
+ Problem: If snapshot is taken, when mkdir has succeeded only on
+ hashed_subvolume, then after restoring snapshot the directory
+ is not shown on mount point.
+
+ Why: dht_readdirp takes only those directory entries in to
+ account, which are present on first_up_subvolume. Hence, if the
+ "hashed subvolume" is not same as first_up_subvolume, it wont be listed
+ on mount point and also not healed.
+
+ Solution:
+ Case 1: (Rebalance not running)If hashed subvolume is NULL or down then
+ filter in first_up_subvolume. Other wise the corresponding hashed subvolume
+ will take care of the directory entry.
+
+ Case 2: If readdirp_optimize option is turned on then read from first_up_subvol
+
+ Change-Id: Idaad28f1c9f688dbfb1a8a3ab8b244510c02365e
+ BUG: 1139986
+ Signed-off-by: Susant Palai <spalai@redhat.com>
+ Reviewed-on: http://review.gluster.org/7599
+ Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
+ Reviewed-on: http://review.gluster.org/8671
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+ Tested-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit 67ccd153a889d81d4cd89534dbce792c111ad1c6
+Author: Venkatesh Somyajulu <vsomyaju@redhat.com>
+Date: Thu Jun 12 14:18:05 2014 +0530
+
+ dht/rebalance: Do not allow rebalance when gfid mismatch found
+
+ Due to race condition, it may so happen that, gfid obtained
+ in readdirp and gfid found by lookup are different for a given
+ name. in that case do no allow the rebalance.
+
+ Readdirp of an entry will bring the gfid, which will be stored
+ in the inode through inode_link, and when lookup is done and
+ gfid brought by lookup is different from the one stored in the
+ inode, client3_3_lookup_cbk will return ESATLE and error will be
+ captured by rebalance process.
+
+ Change-Id: Iad839177ef9b80c1dd0e87f3406bcf4cb018e6fa
+ BUG: 1139984
+ Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com>
+ Reviewed-on: http://review.gluster.org/7973
+ Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
+ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
+ Reviewed-on: http://review.gluster.org/8670
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit f8b5bfd5f329ce06dcd208beaf5c50c3a35f0a53
+Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+Date: Thu Sep 25 11:56:08 2014 -0400
+
+ glusterfs.spec.in: add psmisc to -server subpackage
+
+ apparently some minimalist installs omit psmisc
+ needed for the killall in various %pre and %post scriptlets
+
+ smarter logic for restarting glusterd in %post server
+
+ Change-Id: I1581d278c2be6a917c20785437ce78c502111d8d
+ BUG: 1146624
+ Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+ Reviewed-on: http://review.gluster.org/8859
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+
+commit ab0547eba39b155246f0d9f09e9a580665c6053f
+Author: Niels de Vos <ndevos@redhat.com>
+Date: Thu Sep 25 12:08:47 2014 +0200
+
+ socket: Fixed parsing RPC records containing multi fragments
+
+ In __socket_proto_state_machine(), when parsing RPC records containing
+ multi fragments, just change the state of parsing process, had not
+ processed the memory to coalesce the multi fragments.
+
+ Cherry picked from commit fb6702b7f8ba19333b7ba4af543d908e3f5e1923:
+ > Change-Id: I5583e578603bd7290814a5d26885b31759c73115
+ > BUG: 1139598
+ > Signed-off-by: Gu Feng <flygoast@126.com>
+ > Reviewed-on: http://review.gluster.org/8662
+ > Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ > Reviewed-by: Niels de Vos <ndevos@redhat.com>
+ > Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
+ > Tested-by: Raghavendra G <rgowdapp@redhat.com>
+
+ Change-Id: I5583e578603bd7290814a5d26885b31759c73115
+ BUG: 1146470
+ Signed-off-by: Niels de Vos <ndevos@redhat.com>
+ Reviewed-on: http://review.gluster.org/8849
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit e2a76e76e3d9174fa77f40f3abd0212705283f00
+Author: Krutika Dhananjay <kdhananj@redhat.com>
+Date: Thu Sep 18 14:36:38 2014 +0530
+
+ cluster/dht: Fix dict_t leaks in rebalance process' execution path
+
+ Backport of: http://review.gluster.org/8763
+
+ Two dict_t objects are leaked for every file migrated in success codepath.
+ It is the caller's responsibility to unref dict that it gets from calls to
+ syncop_getxattr(); and rebalance performs two syncop_getxattr()s per file
+ without freeing them.
+
+ Also, syncop_getxattr() on GF_XATTR_LINKINFO_KEY doesn't seem to be using
+ the response dict. Hence, NULL is now passed as opposed to @dict to
+ syncop_getxattr().
+
+ Change-Id: I59556ee6e135e7e65d4ddd31ba0f39e7eb50b02d
+ BUG: 1144792
+ Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
+ Reviewed-on: http://review.gluster.org/8789
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit c0b40b5bb1ff73131c743d74d3da16a28b2cbd28
+Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+Date: Mon Sep 8 10:16:58 2014 -0400
+
+ gNFS: Fix memory leak in setacl code path
+
+ Backport of http://review.gluster.org/#/c/8651 (BZ # 1139195) to
+ release-3.4
+
+ If ACL is set on a file in Gluster NFS mount (setfacl command),
+ and it succeed, then the NFS call state data is leaked. Though
+ all the failure code path frees up the memory.
+
+ Impact: There is a OOM kill i.e. vdsm invoked oom-killer during
+ rebalance and Killed process 4305, UID 0, (glusterfs nfs process)
+
+ FIX:
+ Make sure to deallocate the memory for call state in acl3_setacl_cbk()
+ using nfs3_call_state_wipe();
+
+ Change-Id: I6664a9151e9417e114c858bb2cdb136d9cb0b283
+ BUG: 1139250
+ Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+ Reviewed-on: http://review.gluster.org/8653
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
+ Reviewed-by: Niels de Vos <ndevos@redhat.com>
+
+commit 1d4ef0b891899e3a6dbc8c2087e73cee6f5a7fbe
+Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+Date: Thu Aug 28 12:33:01 2014 -0400
+
+ mount/fuse: Handle fd resolution failures
+
+ Backport from http://review.gluster.org/#/c/8402, BZ 1126048
+
+ Problem:
+ Even when the fd resolution failed, the fop is continuing on the
+ new graph which may not have valid inode. This lead to NULL layout
+ subvols in dht which lead to crash in fsync after graph migration.
+
+ Fix:
+ - Remove resolution error handling in FUSE_FOP as it was only added
+ to handle fd migration failures.
+ - check in fuse_resolve_done for fd resolution failures and fail the
+ fop right away.
+ - loc resolution failures are already handled in the corresponding
+ fops.
+ - Return errno from state->resolve.op_errno in resume functions.
+ - Send error to fuse on frame allocation failures.
+ - Removed unused variable state->resolved
+ - Removed unused macro FUSE_FOP_COOKIE
+
+ Change-Id: I3f3129b9b4fc34ff1fe07218e6924a027346a95e
+ BUG: 1123289
+ Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+ Reviewed-on: http://review.gluster.org/8562
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
+
+commit f0ddba7e0913db505f1295e9b3b7d35ead9c4407
+Author: Pranith Kumar K <pkarampu@redhat.com>
+Date: Tue Aug 26 12:59:47 2014 +0530
+
+ cluster/afr: Fix memory leak of file-path in self-heal-daemon
+
+ Backport of http://review.gluster.org/4790
+
+ Note: Only the part which fixes the memory leak is backported
+
+ shd event has path which needs to be freed as part of circular buffer cleanup.
+ This patch introduces the functionality so that self-heal-daemon can use it.
+
+ Change-Id: I3f3823d5587eda2fcb278f0fdb89123a31c9d786
+ BUG: 1119894
+ Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
+ Reviewed-on: http://review.gluster.org/8541
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Ravishankar N <ravishankar@redhat.com>
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit 1679b72c5b023884fb4bc6a2a85b06016fb3cab8
+Author: Niels de Vos <ndevos@redhat.com>
+Date: Thu Aug 21 18:24:33 2014 +0200
+
+ NFS: stripe-xlator should pass EOF at end of READDIR
+
+ NFS READDIR replies are made of a header, a sequence of
+ entries, and a EOF flag. When GlusterFS's NFS server is
+ used along with stripe xlator, it fails to set the EOF
+ flag, which violates NFS RFC and confuses some clients.
+
+ The bug is caused because nfs xlator sets EOF if it gets
+ op_errno set to ENOENT. That value is produced in storage
+ xlator and propagated through server, client, and other
+ xlators until stripe xlator handles it. stripe only passed
+ op_errno if op_ret < 0, which is not the case here. This
+ change set adds a special case for that situation to fix
+ the problem.
+
+ Cherry picked from commit 9b5231e5c98b8cfa116838287c7a14042702795f:
+ > Change-Id: Ie6db94b0515292387cfb04c1e4a9363f34fcd19a
+ > BUG: 1130969
+ > Reported-by: Emmanuel Dreyfus <manu@netbsd.org>
+ > Signed-off-by: Niels de Vos <ndevos@redhat.com>
+ > Reviewed-on: http://review.gluster.org/8493
+ > Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ > Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
+ > Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+ > Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org>
+ > Tested-by: Emmanuel Dreyfus <manu@netbsd.org>
+
+ Change-Id: Ie6db94b0515292387cfb04c1e4a9363f34fcd19a
+ BUG: 1132392
+ Signed-off-by: Niels de Vos <ndevos@redhat.com>
+ Reviewed-on: http://review.gluster.org/8510
+ Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+
+commit 7b564b88003aaef9d679ed0983e51f03dfd6d2f4
+Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+Date: Wed Jul 23 12:57:24 2014 -0400
+
+ doc/release-nodes: release notes for 3.4.5 GA
+
+ Change-Id: I359c280b67006473a836c90771b28598fe712c80
+ BUG: 1110456
+ Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+ Reviewed-on: http://review.gluster.org/8370
+
+commit e311014d94c7fcfd8c5e7abe3aca7d99f43e0d91
+Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+Date: Tue Jul 8 08:25:36 2014 -0400
+
+ nfs: prevent assertion error with MOUNT over UDP
+
+ see http://review.gluster.org/#/c/8258/, http://review.gluster.org/8241;
+ and BZs 1116997, 1116503, respectively.
+
+ The MOUNT service over UDP runs in a separate thread. This thread does
+ not have the correct *THIS xlator set. *THIS points to the global (base)
+ xlator structure, but GF_CALLOC() requires it to be the NFS-xlator so
+ that assertions can get validated correctly.
+
+ This is solved by passing the NFS-xlator to the pthread function, and
+ setting the *THIS pointer explicitly in the new thread.
+
+ It seems that on occasion (needs further investigation) MOUNT over UDP
+ does not unregister itself. There can also be issues when the kernel NLM
+ implementation has been registered at portmap/rpcbind, so adding some
+ unregister procedures in the cleanup of the test-cases.
+
+ Change-Id: Iea3bafd65bf480f2b12da91875c73571594d52d3
+ BUG: 1117256
+ Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+ Reviewed-on: http://review.gluster.org/8262
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Niels de Vos <ndevos@redhat.com>
+ Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
+
+commit b3bf2cfaa8e932f02a10a42e0281290a7cbdc960
+Author: Vijay Bellur <vbellur@redhat.com>
+Date: Sat Jul 5 21:19:01 2014 +0530
+
+ performance/quick-read: Check for iobuf and iobref before unref.
+
+ In the absence of this check, iobuf_unref() can cause a log flood
+ for read operations.
+
+ Change-Id: Ib8beef6e55b69ecfb566bf61a96215ef0d0d74dc
+ BUG: 1116514
+ Signed-off-by: Vijay Bellur <vbellur@redhat.com>
+ Reviewed-on: http://review.gluster.org/8242
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
+ Reviewed-by: Prashanth Pai <ppai@redhat.com>
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit ecc21940eaa44a38618e8d1d9c9690fffbd5ac72
+Author: Justin Clift <justin@gluster.org>
+Date: Tue Jun 24 20:57:02 2014 +0100
+
+ fuse: fix memory leak in fuse_getxattr()
+
+ The fuse_getxattr() function was not freeing fuse_state_t resulting in a
+ memory leak. As a result, when continuous writes (run dd command in a loop)
+ were done from a FUSE mount point, the OOM killer killed the client
+ process (glusterfs).
+
+ Manual backport of: http://review.gluster.org/#/c/5392/, provided
+ by Martin Svec <martin.svec@zoner.cz>.
+
+ BUG: 1112844
+ Change-Id: Ic723675c53384d48c79ad1b11b21c1b17fb56866
+ Reviewed-on: http://review.gluster.org/8164
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Ravishankar N <ravishankar@redhat.com>
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit 33b61346caee59391cd1681623cdac85cbfc04f6
+Author: Joe Julian <me@joejulian.name>
+Date: Thu May 22 10:41:21 2014 -0700
+
+ doc: Fix peer probe deficiencies
+
+ Added the command to probe the first server to assign it a hostname
+
+ Change-Id: I67f35553df74718f23cd8453dc7854a44c61be11
+ BUG: 1095596
+ Reviewed-on: http://review.gluster.org/7854
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit 2b789331dc933b186360fc8cbffb06289ee60ee9
+Author: Vijay Bellur <vbellur@redhat.com>
+Date: Tue Jun 10 22:21:28 2014 +0530
+
+ cluster/dht: Don't do extra unref in dht-migration checks
+
+ Problem:
+ syncop_open used to perform a ref in syncop_open_cbk so the extra
+ unref was needed but now syncop_open_cbk does not take a ref so no
+ need to do extra unref.
+
+ Fix:
+ remove the extra fd_unref and let dht_local_wipe do the final unref.
+
+ Change-Id: Ibe8f9a678d456a0c7bff175306068b5cd297ecc4
+ BUG: 961615
+ Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
+ Signed-off-by: Vijay Bellur <vbellur@redhat.com>
+ Reviewed-on: http://review.gluster.org/8029
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Tested-by: Joe Julian <joe@julianfamily.org>
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
+commit 8005d56f080a27f2f408a85f2bf28b3470668ece
+Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+Date: Sun May 25 10:40:31 2014 -0400
+
+ release-notes: 3.4.4
+
+ Change-Id: I9553500016a6a56d1aaf7bc7f90249bed95fa1b1
+ BUG: 1095324
+ Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+ Reviewed-on: http://review.gluster.org/7866
+
+commit d5e317718f4137431c3996ac5f38e9226620e760
+Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+Date: Mon Apr 28 14:25:09 2014 -0400
+
+ core: fix Ubuntu code audit (cppcheck) results
+
+ These block inclusion in Ubuntu Main repo.
+
+ AFAICT these are false positives:
+
+ [rpc/rpc-transport/rdma/src/rdma.c:3074]: (error) Address of local auto-variable assigned to a function parameter.
+ [xlators/features/marker/utils/src/gsyncd.c:99]: (error) Memory leak: str
+ [xlators/features/marker/utils/src/gsyncd.c:354]: (error) Memory leak: argv
+ [xlators/nfs/server/src/nlm4.c:1176]: (error) Possible null pointer dereference: fde
+
+ The remainder are fixed with this change-set:
+
+ [api/src/glfs-fops.c:700]: (error) Possible null pointer dereference: gio
+ [api/src/glfs-fops.c:702]: (error) Possible null pointer dereference: frame
+ [xlators/cluster/afr/src/afr-inode-write.c:375]: (error) Possible null pointer dereference: frame
+ [xlators/cluster/afr/src/afr-self-heal-common.c:1522]: (error) Possible null pointer dereference: local
+ [xlators/cluster/dht/src/dht-rebalance.c:1574]: (error) Possible null pointer dereference: ctx
+ [xlators/cluster/stripe/src/stripe.c:4407]: (error) Possible null pointer dereference: local
+ [xlators/mgmt/glusterd/src/glusterd-mountbroker.c:675]: (error) Possible null pointer dereference: cookieswitch
+ [xlators/mgmt/glusterd/src/glusterd-mountbroker.c:677]: (error) Possible null pointer dereference: cookieswitch
+ [xlators/mgmt/glusterd/src/glusterd-replace-brick.c:924]: (error) Resource leak: file
+ [xlators/mgmt/glusterd/src/glusterd-replace-brick.c:1008]: (error) Resource leak: file
+ [xlators/mgmt/glusterd/src/glusterd-sm.c:248]: (error) Possible null pointer dereference: new_ev_ctx
+ [xlators/mgmt/glusterd/src/glusterd-store.c:1250]: (error) Possible null pointer dereference: handle
+ [xlators/mgmt/glusterd/src/glusterd-utils.c:4272]: (error) Possible null pointer dereference: this
+ [xlators/mgmt/glusterd/src/glusterd-utils.c:5113]: (error) Possible null pointer dereference: this
+ [xlators/mount/fuse/src/fuse-bridge.c:4432]: (error) Uninitialized variable: finh
+ [xlators/mount/fuse/src/fuse-bridge.c:2927]: (error) Possible null pointer dereference: state
+ [xlators/mount/fuse/src/fuse-bridge.c:3226]: (error) Possible null pointer dereference: state
+ [xlators/storage/bd_map/src/bd_map.c:1504]: (error) Possible null pointer dereference: bd_fd
+ [xlators/storage/bd_map/src/bd_map.c:1728]: (error) Possible null pointer dereference: n_entry
+ [xlators/storage/bd_map/src/bd_map.c:1741]: (error) Possible null pointer dereference: n_entry
+ [xlators/performance/quick-read/src/quick-read.c:585]: (error) Possible null pointer dereference: iobuf
+
+ rerunning cppcheck --force afterwards:
+
+ Test code, don't care:
+ [extras/test/test-ffop.c:27]: (error) Buffer overrun possible for long command line arguments.
+
+ False positive after fix
+ [xlators/cluster/stripe/src/stripe.c:4407]: (error) Possible null pointer dereference: local
+
+ Still false positive:
+ [xlators/features/marker/utils/src/gsyncd.c:354]: (error) Memory leak: argv
+ [xlators/nfs/server/src/nlm4.c:1176]: (error) Possible null pointer dereference: fde
+
+ Not built, don't care:
+ [xlators/cluster/ha/src/ha.c:2699]: (error) Possible null pointer dereference: priv
+
+ Change-Id: I1fb849e9c042d3a3701cb05121d413e58e73d505
+ BUG: 1086460
+ Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+ Reviewed-on: http://review.gluster.org/7583
+ Reviewed-by: Vijay Bellur <vbellur@redhat.com>
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+
+commit 4f8f96c62b21185f27d8e76912a808af80e22608
+Author: Xavier Hernandez <xhernandez@datalab.es>
+Date: Thu May 23 11:13:25 2013 +0200
+
+ storage/posix: do not dereference gfid symlinks before posix_handle_mkdir_hashes()
+
+ Whenever a new directory is created, its corresponding gfid file must
+ also be created. This was done first calling MAKE_HANDLE_PATH() to get
+ the path of the gfid file, then calling posix_handle_mkdir_hashes() to
+ create the parent directories of the gfid, and finally creating the
+ soft-link.
+
+ In normal circumstances, the gfid we want to create won't exist and
+ MAKE_HANDLE_PATH() will return a simple path to the new gfid. However if
+ the volume is damaged and a self-heal is running, it is possible that we
+ try to create an already existing gfid. In this case, MAKE_HANDLE_PATH()
+ will return a path to the directory instead of the path to the gfid.
+
+ To solve this problem, every time a path to a gfid is needed, a call to
+ MAKE_HANDLE_ABSPATH() is made instead of the call to MAKE_HANDLE_PATH().
+
+ BUG: 1099955
+ Change-Id: I5bcd2b3c38d172c75946f33519e057e76d960a24
+ Signed-off-by: Xavier Hernandez <xhernandez@datalab.es>
+ Reviewed-on: http://review.gluster.org/6737
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+
+commit 27482ac4678ce7df56126bb9accfebceab1d9fa8
+Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+Date: Wed May 7 09:29:24 2014 -0400
+
+ nfs: exit when all volumes are disabled
+
+ Instead of triggering 4-5 error logs, when nfs is
+ disabled for all volumes, exit the process.
+
+ backport from 3.5
+
+ Change-Id: I191294232f5848a4a01609b477289d628cf89ba5
+ BUG: 1095330
+ Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
+ Reviewed-on: http://review.gluster.org/7699
+ Tested-by: Gluster Build System <jenkins@build.gluster.com>
+ Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
+ Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
+
+commit c1c7ae92a2b6bb7d57270fadd7a5d61c90fa3781
+Author: Rajesh Joseph <rjoseph@redhat.com>
+Date: Thu Aug 1 12:55:51 2013 +0530
+
+ nfs: Fix for NFS crash during blocking NLM call.
+
+ Bug 990887: During a blocking NLM call NFS server is crashing.
+
+ Cause: When nlm4_establish_callback function is called from nlm4svc_send_granted the cs->req->trans
+ pointer is NULL. Thus using this pointer will result in a crash. Whereas cs->trans points to a
+ valid transport object. NLM should use cs->trans instead of cs->req->trans.
+
+ Fix: Replaced cs->req->trans with cs->trans.
+
+ Backport of: http://review.gluster.org/#/c/5452/
+
+ BUG: 990887
+ Change-Id: I33d4b6634752333d6791b1a47ebf10c787c22120
+ Signed-off-by: Justin Clift <justin@gluster.org>
+ Reviewed-on: http://review.gluster.org/7478
+ Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
+ Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
+
commit b0d6d20ab23627861a2d228d2124dee5e2ab9771
Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Date: Wed Apr 2 14:25:33 2014 -0400
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/api/src/glfs-fops.c
^
|
@@ -697,9 +697,11 @@
out:
if (ret) {
- GF_FREE (gio->iov);
+ if (gio)
+ GF_FREE (gio->iov);
GF_FREE (gio);
- STACK_DESTROY (frame->root);
+ if (frame)
+ STACK_DESTROY (frame->root);
glfs_subvol_done (fs, subvol);
}
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/configure
^
|
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for glusterfs 3.4.3.
+# Generated by GNU Autoconf 2.63 for glusterfs 3.4.6.
#
# Report bugs to <gluster-users@gluster.org>.
#
@@ -745,8 +745,8 @@
# Identity of this package.
PACKAGE_NAME='glusterfs'
PACKAGE_TARNAME='glusterfs'
-PACKAGE_VERSION='3.4.3'
-PACKAGE_STRING='glusterfs 3.4.3'
+PACKAGE_VERSION='3.4.6'
+PACKAGE_STRING='glusterfs 3.4.6'
PACKAGE_BUGREPORT='gluster-users@gluster.org'
# Factoring default headers for most tests.
@@ -1553,7 +1553,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures glusterfs 3.4.3 to adapt to many kinds of systems.
+\`configure' configures glusterfs 3.4.6 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1623,7 +1623,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of glusterfs 3.4.3:";;
+ short | recursive ) echo "Configuration of glusterfs 3.4.6:";;
esac
cat <<\_ACEOF
@@ -1750,7 +1750,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-glusterfs configure 3.4.3
+glusterfs configure 3.4.6
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1764,7 +1764,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by glusterfs $as_me 3.4.3, which was
+It was created by glusterfs $as_me 3.4.6, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -2616,7 +2616,7 @@
# Define the identity of the package.
PACKAGE='glusterfs'
- VERSION='3.4.3'
+ VERSION='3.4.6'
cat >>confdefs.h <<_ACEOF
@@ -17665,7 +17665,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by glusterfs $as_me 3.4.3, which was
+This file was extended by glusterfs $as_me 3.4.6, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -17728,7 +17728,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-glusterfs config.status 3.4.3
+glusterfs config.status 3.4.6
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/configure.ac
^
|
@@ -6,7 +6,7 @@
dnl later), or the GNU General Public License, version 2 (GPLv2), in all
dnl cases as published by the Free Software Foundation.
-AC_INIT([glusterfs],[3.4.3],[gluster-users@gluster.org])
+AC_INIT([glusterfs],[3.4.6],[gluster-users@gluster.org])
AM_INIT_AUTOMAKE
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/glusterfs.spec
^
|
@@ -7,7 +7,7 @@
# global prereltag beta4
# if you wish to compile an rpm without rdma support, compile like this...
-# rpmbuild -ta glusterfs-3.4.3.tar.gz --without rdma
+# rpmbuild -ta glusterfs-3.4.6.tar.gz --without rdma
%{?_without_rdma:%global _without_rdma --disable-ibverbs}
# No RDMA Support on s390(x)
@@ -16,26 +16,26 @@
%endif
# if you wish to compile an rpm without epoll...
-# rpmbuild -ta glusterfs-3.4.3.tar.gz --without epoll
+# rpmbuild -ta glusterfs-3.4.6.tar.gz --without epoll
%{?_without_epoll:%global _without_epoll --disable-epoll}
# if you wish to compile an rpm without fusermount...
-# rpmbuild -ta glusterfs-3.4.3.tar.gz --without fusermount
+# rpmbuild -ta glusterfs-3.4.6.tar.gz --without fusermount
%{?_without_fusermount:%global _without_fusermount --disable-fusermount}
# if you wish to compile an rpm without geo-replication support, compile like this...
-# rpmbuild -ta glusterfs-3.4.3.tar.gz --without georeplication
+# rpmbuild -ta glusterfs-3.4.6.tar.gz --without georeplication
%{?_without_georeplication:%global _without_georeplication --disable-geo-replication}
# if you wish to compile an rpm without the OCF resource agents...
-# rpmbuild -ta glusterfs-3.4.3.tar.gz --without ocf
+# rpmbuild -ta glusterfs-3.4.6.tar.gz --without ocf
%{?_without_ocf:%global _without_ocf --without-ocf}
# there is no systemtap support! Perhaps some day there will be
%global _without_systemtap --enable-systemtap=no
# if you wish to compile an rpm without the BD map support...
-# rpmbuild -ta glusterfs-3.4.3.tar.gz --without bd
+# rpmbuild -ta glusterfs-3.4.6.tar.gz --without bd
%{?_without_bd:%global _without_bd --disable-bd-xlator}
%if ( 0%{?rhel} && 0%{?rhel} < 6 )
@@ -60,7 +60,7 @@
Vendor: Fedora Project
%else
Name: glusterfs
-Version: 3.4.3
+Version: 3.4.6
Release: 1%{?dist}
Vendor: glusterfs.org
%endif
@@ -81,7 +81,7 @@
Patch1: %{name}-3.3.0.libglusterfs.Makefile.patch
Patch2: %{name}-3.3.1.rpc.rpcxprt.rdma.name.c.patch
%else
-Source0: glusterfs-3.4.3.tar.gz
+Source0: glusterfs-3.4.6.tar.gz
%endif
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
@@ -97,6 +97,7 @@
%define _init_enable() /bin/systemctl enable %1.service ;
%define _init_disable() /bin/systemctl disable %1.service ;
%define _init_restart() /bin/systemctl try-restart %1.service ;
+%define _init_start() /bin/systemctl start %1.service ;
%define _init_stop() /bin/systemctl stop %1.service ;
%define _init_install() %{__install} -D -p -m 0644 %1 %{buildroot}%{_unitdir}/%2.service ;
# can't seem to make a generic macro that works
@@ -113,6 +114,7 @@
%define _init_enable() /sbin/chkconfig --add %1 ;
%define _init_disable() /sbin/chkconfig --del %1 ;
%define _init_restart() /sbin/service %1 condrestart &>/dev/null ;
+%define _init_start() /sbin/service %1 start &>/dev/null ;
%define _init_stop() /sbin/service %1 stop &>/dev/null ;
%define _init_install() %{__install} -D -p -m 0755 %1 %{buildroot}%{_sysconfdir}/init.d/%2 ;
# can't seem to make a generic macro that works
@@ -267,6 +269,9 @@
Requires: %{name}-cli = %{version}-%{release}
Requires: %{name}-libs = %{version}-%{release}
Requires: %{name}-fuse = %{version}-%{release}
+# psmisc for killall, and nfs-utils and rpcbind/portmap for gnfs server
+Requires: psmisc
+Requires: nfs-utils
%if ( 0%{?fedora} ) || ( 0%{?rhel} && 0%{?rhel} >= 6 )
Requires: rpcbind
%else
@@ -751,6 +756,9 @@
killall glusterd &> /dev/null
glusterd --xlator-option *.upgrade=on -N
+ # glusterd _was_ running, we killed it, it exited after *.upgrade=on,
+ # so start it again
+ %_init_start glusterd
else
glusterd --xlator-option *.upgrade=on -N
fi
@@ -774,6 +782,9 @@
fi
%changelog
+* Fri Jun 27 2014 Kaleb S. KEITHLEY <kkeithle@redhat.com>
+- psmisc (and nfsutils), better %post server logic (#1146624)
+
* Sat Jan 4 2014 Niels de Vos <ndevos@redhat.com>
- The main glusterfs package should not provide glusterfs-libs (#1048489)
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/glusterfs.spec.in
^
|
@@ -97,6 +97,7 @@
%define _init_enable() /bin/systemctl enable %1.service ;
%define _init_disable() /bin/systemctl disable %1.service ;
%define _init_restart() /bin/systemctl try-restart %1.service ;
+%define _init_start() /bin/systemctl start %1.service ;
%define _init_stop() /bin/systemctl stop %1.service ;
%define _init_install() %{__install} -D -p -m 0644 %1 %{buildroot}%{_unitdir}/%2.service ;
# can't seem to make a generic macro that works
@@ -113,6 +114,7 @@
%define _init_enable() /sbin/chkconfig --add %1 ;
%define _init_disable() /sbin/chkconfig --del %1 ;
%define _init_restart() /sbin/service %1 condrestart &>/dev/null ;
+%define _init_start() /sbin/service %1 start &>/dev/null ;
%define _init_stop() /sbin/service %1 stop &>/dev/null ;
%define _init_install() %{__install} -D -p -m 0755 %1 %{buildroot}%{_sysconfdir}/init.d/%2 ;
# can't seem to make a generic macro that works
@@ -267,6 +269,9 @@
Requires: %{name}-cli = %{version}-%{release}
Requires: %{name}-libs = %{version}-%{release}
Requires: %{name}-fuse = %{version}-%{release}
+# psmisc for killall, and nfs-utils and rpcbind/portmap for gnfs server
+Requires: psmisc
+Requires: nfs-utils
%if ( 0%{?fedora} ) || ( 0%{?rhel} && 0%{?rhel} >= 6 )
Requires: rpcbind
%else
@@ -751,6 +756,9 @@
killall glusterd &> /dev/null
glusterd --xlator-option *.upgrade=on -N
+ # glusterd _was_ running, we killed it, it exited after *.upgrade=on,
+ # so start it again
+ %_init_start glusterd
else
glusterd --xlator-option *.upgrade=on -N
fi
@@ -774,6 +782,9 @@
fi
%changelog
+* Fri Jun 27 2014 Kaleb S. KEITHLEY <kkeithle@redhat.com>
+- psmisc (and nfsutils), better %post server logic (#1146624)
+
* Sat Jan 4 2014 Niels de Vos <ndevos@redhat.com>
- The main glusterfs package should not provide glusterfs-libs (#1048489)
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/libglusterfs/src/circ-buff.c
^
|
@@ -10,6 +10,17 @@
#include "circ-buff.h"
+void
+cb_destroy_data (circular_buffer_t *cb,
+ void (*destroy_buffer_data) (void *data))
+{
+ if (destroy_buffer_data)
+ destroy_buffer_data (cb->data);
+ GF_FREE (cb->data);
+ return;
+}
+
+
/* hold lock while calling this function */
int
__cb_add_entry_buffer (buffer_t *buffer, void *item)
@@ -29,7 +40,8 @@
if (buffer->cb[buffer->w_index]) {
ptr = buffer->cb[buffer->w_index];
if (ptr->data) {
- GF_FREE (ptr->data);
+ cb_destroy_data (ptr,
+ buffer->destroy_buffer_data);
ptr->data = NULL;
GF_FREE (ptr);
}
@@ -118,7 +130,8 @@
}
buffer_t *
-cb_buffer_new (size_t buffer_size, gf_boolean_t use_once)
+cb_buffer_new (size_t buffer_size, gf_boolean_t use_once,
+ void (*destroy_buffer_data) (void *data))
{
buffer_t *buffer = NULL;
@@ -144,6 +157,7 @@
buffer->size_buffer = buffer_size;
buffer->use_once = use_once;
buffer->used_len = 0;
+ buffer->destroy_buffer_data = destroy_buffer_data;
pthread_mutex_init (&buffer->lock, NULL);
out:
@@ -153,12 +167,18 @@
void
cb_buffer_destroy (buffer_t *buffer)
{
- int i = 0;
-
+ int i = 0;
+ circular_buffer_t *ptr = NULL;
if (buffer) {
if (buffer->cb) {
for (i = 0; i < buffer->used_len ; i++) {
- GF_FREE (buffer->cb[i]);
+ ptr = buffer->cb[i];
+ if (ptr->data) {
+ cb_destroy_data (ptr,
+ buffer->destroy_buffer_data);
+ ptr->data = NULL;
+ GF_FREE (ptr);
+ }
}
GF_FREE (buffer->cb);
}
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/libglusterfs/src/circ-buff.h
^
|
@@ -38,7 +38,7 @@
/* indicates the amount of circular buffer used. */
circular_buffer_t **cb;
-
+ void (*destroy_buffer_data) (void *data);
pthread_mutex_t lock;
};
@@ -51,7 +51,8 @@
cb_buffer_show (buffer_t *buffer);
buffer_t *
-cb_buffer_new (size_t buffer_size,gf_boolean_t use_buffer_once);
+cb_buffer_new (size_t buffer_size,gf_boolean_t use_buffer_once,
+ void (*destroy_data) (void *data));
void
cb_buffer_destroy (buffer_t *buffer);
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/libglusterfs/src/event-history.c
^
|
@@ -11,7 +11,8 @@
#include "event-history.h"
eh_t *
-eh_new (size_t buffer_size, gf_boolean_t use_buffer_once)
+eh_new (size_t buffer_size, gf_boolean_t use_buffer_once,
+ void (*destroy_buffer_data) (void *data))
{
eh_t *history = NULL;
buffer_t *buffer = NULL;
@@ -22,7 +23,8 @@
goto out;
}
- buffer = cb_buffer_new (buffer_size, use_buffer_once);
+ buffer = cb_buffer_new (buffer_size, use_buffer_once,
+ destroy_buffer_data);
if (!buffer) {
gf_log ("", GF_LOG_ERROR, "allocating circular buffer failed");
GF_FREE (history);
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/libglusterfs/src/event-history.h
^
|
@@ -32,7 +32,8 @@
int (fn) (circular_buffer_t *buffer, void *data));
eh_t *
-eh_new (size_t buffer_size, gf_boolean_t use_buffer_once);
+eh_new (size_t buffer_size, gf_boolean_t use_buffer_once,
+ void (*destroy_data) (void *data));
int
eh_save_history (eh_t *history, void *string);
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/libglusterfs/src/glusterfs.h
^
|
@@ -149,6 +149,15 @@
#define GF_REBALANCE_TID_KEY "rebalance-id"
#define GF_REMOVE_BRICK_TID_KEY "remove-brick-id"
#define GF_REPLACE_BRICK_TID_KEY "replace-brick-id"
+#define DHT_SKIP_NON_LINKTO_UNLINK "unlink-only-if-dht-linkto-file"
+#define DHT_SKIP_OPEN_FD_UNLINK "dont-unlink-for-open-fd"
+
+#define DHT_LINKFILE_MODE (S_ISVTX)
+
+#define IS_DHT_LINKFILE_MODE(iabuf) ((st_mode_from_ia ((iabuf)->ia_prot, \
+ (iabuf)->ia_type) \
+ & ~S_IFMT) \
+ == DHT_LINKFILE_MODE)
/* NOTE: add members ONLY at the end (just before _MAXVALUE) */
typedef enum {
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/libglusterfs/src/syncop.c
^
|
@@ -2102,3 +2102,43 @@
return args.op_ret;
}
+
+int32_t
+syncop_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata)
+{
+ struct syncargs *args = NULL;
+
+ args = cookie;
+
+ args->op_ret = op_ret;
+ args->op_errno = op_errno;
+
+ if (xdata)
+ args->xdata = dict_ref (xdata);
+
+ __wake (args);
+
+ return 0;
+
+}
+
+int
+syncop_inodelk (xlator_t *subvol, const char *volume, loc_t *loc, int32_t cmd,
+ struct gf_flock *lock, dict_t *xdata_req, dict_t **xdata_rsp)
+{
+ struct syncargs args = {0, };
+
+ SYNCOP (subvol, (&args), syncop_inodelk_cbk, subvol->fops->inodelk,
+ volume, loc, cmd, lock, xdata_req);
+
+ if (xdata_rsp)
+ *xdata_rsp = args.xdata;
+ else
+ dict_unref (args.xdata);
+
+ if (args.op_ret < 0)
+ return -args.op_errno;
+
+ return args.op_ret;
+}
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/libglusterfs/src/syncop.h
^
|
@@ -396,4 +396,8 @@
int syncop_lk (xlator_t *subvol, fd_t *fd, int cmd, struct gf_flock *flock);
+int
+syncop_inodelk (xlator_t *subvol, const char *volume, loc_t *loc, int32_t cmd,
+ struct gf_flock *lock, dict_t *xdata_req, dict_t **xdata_rsp);
+
#endif /* _SYNCOP_H */
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/rpc/rpc-transport/socket/src/socket.c
^
|
@@ -45,6 +45,73 @@
#define SSL_CA_LIST_OPT "transport.socket.ssl-ca-list"
#define OWN_THREAD_OPT "transport.socket.own-thread"
+/*
+ * This list was derived by taking the cipher list "HIGH:!SSLv2" (the previous
+ * default) and excluding CBC entries to mitigate the "POODLE" attack. It
+ * should be re-evaluated in light of each future vulnerability, as those are
+ * discovered.
+ */
+static char *
+default_cipher_list =
+ "ECDHE-RSA-AES256-GCM-SHA384:"
+ "ECDHE-ECDSA-AES256-GCM-SHA384:"
+ "ECDHE-RSA-AES256-SHA384:"
+ "ECDHE-ECDSA-AES256-SHA384:"
+ "ECDHE-RSA-AES256-SHA:"
+ "ECDHE-ECDSA-AES256-SHA:"
+ "DHE-DSS-AES256-GCM-SHA384:"
+ "DHE-RSA-AES256-GCM-SHA384:"
+ "DHE-RSA-AES256-SHA256:"
+ "DHE-DSS-AES256-SHA256:"
+ "DHE-RSA-AES256-SHA:"
+ "DHE-DSS-AES256-SHA:"
+ "DHE-RSA-CAMELLIA256-SHA:"
+ "DHE-DSS-CAMELLIA256-SHA:"
+ "AECDH-AES256-SHA:"
+ "ADH-AES256-GCM-SHA384:"
+ "ADH-AES256-SHA256:"
+ "ADH-AES256-SHA:"
+ "ADH-CAMELLIA256-SHA:"
+ "ECDH-RSA-AES256-GCM-SHA384:"
+ "ECDH-ECDSA-AES256-GCM-SHA384:"
+ "ECDH-RSA-AES256-SHA384:"
+ "ECDH-ECDSA-AES256-SHA384:"
+ "ECDH-RSA-AES256-SHA:"
+ "ECDH-ECDSA-AES256-SHA:"
+ "AES256-GCM-SHA384:"
+ "AES256-SHA256:"
+ "AES256-SHA:"
+ "CAMELLIA256-SHA:"
+ "ECDHE-RSA-AES128-GCM-SHA256:"
+ "ECDHE-ECDSA-AES128-GCM-SHA256:"
+ "ECDHE-RSA-AES128-SHA256:"
+ "ECDHE-ECDSA-AES128-SHA256:"
+ "ECDHE-RSA-AES128-SHA:"
+ "ECDHE-ECDSA-AES128-SHA:"
+ "DHE-DSS-AES128-GCM-SHA256:"
+ "DHE-RSA-AES128-GCM-SHA256:"
+ "DHE-RSA-AES128-SHA256:"
+ "DHE-DSS-AES128-SHA256:"
+ "DHE-RSA-AES128-SHA:"
+ "DHE-DSS-AES128-SHA:"
+ "DHE-RSA-CAMELLIA128-SHA:"
+ "DHE-DSS-CAMELLIA128-SHA:"
+ "AECDH-AES128-SHA:"
+ "ADH-AES128-GCM-SHA256:"
+ "ADH-AES128-SHA256:"
+ "ADH-AES128-SHA:"
+ "ADH-CAMELLIA128-SHA:"
+ "ECDH-RSA-AES128-GCM-SHA256:"
+ "ECDH-ECDSA-AES128-GCM-SHA256:"
+ "ECDH-RSA-AES128-SHA256:"
+ "ECDH-ECDSA-AES128-SHA256:"
+ "ECDH-RSA-AES128-SHA:"
+ "ECDH-ECDSA-AES128-SHA:"
+ "AES128-GCM-SHA256:"
+ "AES128-SHA256:"
+ "AES128-SHA:"
+ "CAMELLIA128-SHA"; /* no colon for last entry */
+
/* TBD: do automake substitutions etc. (ick) to set these. */
#if !defined(DEFAULT_CERT_PATH)
#define DEFAULT_CERT_PATH "/etc/ssl/glusterfs.pem"
@@ -382,10 +449,11 @@
/* first call after passing SP_STATE_READING_FRAGHDR */
in->ra_max = min (RPC_FRAGSIZE (in->fraghdr), GF_SOCKET_RA_MAX);
/* Note that the in->iobuf is the primary iobuf into which
- headers are read into. By using this itself as our
+ headers are read into, and in->frag.fragcurrent points to
+ some position in the buffer. By using this itself as our
read-ahead cache, we can avoid memory copies in iov_load
*/
- in->ra_buf = iobuf_ptr (in->iobuf);
+ in->ra_buf = in->frag.fragcurrent;
}
/* fill read-ahead */
@@ -1987,9 +2055,22 @@
goto out;
}
+ if (in->iobuf == NULL) {
+ /* first fragment */
+ frag->fragcurrent = iobuf_ptr (iobuf);
+ } else {
+ /* second or further fragment */
+ memcpy(iobuf_ptr (iobuf), iobuf_ptr (in->iobuf),
+ in->total_bytes_read - RPC_FRAGSIZE(in->fraghdr));
+ iobuf_unref (in->iobuf);
+ frag->fragcurrent = (char *) iobuf_ptr (iobuf) +
+ in->total_bytes_read - RPC_FRAGSIZE(in->fraghdr);
+ frag->pending_vector->iov_base = frag->fragcurrent;
+ in->pending_vector = frag->pending_vector;
+ }
+
in->iobuf = iobuf;
in->iobuf_size = 0;
- frag->fragcurrent = iobuf_ptr (iobuf);
in->record_state = SP_STATE_READING_FRAG;
/* fall through */
@@ -2004,6 +2085,9 @@
frag->bytes_read = 0;
if (!RPC_LASTFRAG (in->fraghdr)) {
+ in->pending_vector = in->vector;
+ in->pending_vector->iov_base = &in->fraghdr;
+ in->pending_vector->iov_len = sizeof(in->fraghdr);
in->record_state = SP_STATE_READING_FRAGHDR;
break;
}
@@ -3501,7 +3585,7 @@
priv->ssl_ctx = SSL_CTX_new(priv->ssl_meth);
if (SSL_CTX_set_cipher_list(priv->ssl_ctx,
- "HIGH:-SSLv2") == 0) {
+ default_cipher_list) == 0) {
gf_log(this->name,GF_LOG_ERROR,
"failed to find any valid ciphers");
goto err;
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/cluster/afr/src/afr-common.c
^
|
@@ -2971,6 +2971,72 @@
/* }}} */
+int32_t
+afr_unlock_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata)
+
+{
+ afr_local_t *local = NULL;
+ afr_private_t *priv = NULL;
+ int call_count = -1;
+ int child_index = (long)cookie;
+ uuid_t gfid = {0};
+
+ local = frame->local;
+ priv = this->private;
+
+ if (op_ret < 0 && op_errno != ENOTCONN) {
+ loc_gfid (&local->loc, gfid);
+ gf_log (this->name, GF_LOG_ERROR, "%s: Failed to unlock %s "
+ "with lk_owner: %s (%s)", uuid_utoa (gfid),
+ priv->children[child_index]->name,
+ lkowner_utoa (&frame->root->lk_owner),
+ strerror (op_errno));
+ }
+
+ call_count = afr_frame_return (frame);
+ if (call_count == 0) {
+ AFR_STACK_UNWIND (inodelk, frame, local->op_ret,
+ local->op_errno, local->xdata_rsp);
+ }
+
+ return 0;
+}
+
+int32_t
+afr_unlock_inodelks_and_unwind (call_frame_t *frame, xlator_t *this,
+ int call_count)
+{
+ int i = 0;
+ afr_private_t *priv = NULL;
+ afr_local_t *local = NULL;
+
+ local = frame->local;
+ priv = this->private;
+ local->call_count = call_count;
+ local->cont.inodelk.flock.l_type = F_UNLCK;
+
+ for (i = 0; i < priv->child_count; i++) {
+ if (!local->child_up[i])
+ continue;
+
+ if (local->child_errno[i])
+ continue;
+
+ STACK_WIND_COOKIE (frame, afr_unlock_inodelk_cbk,
+ (void*) (long) i,
+ priv->children[i],
+ priv->children[i]->fops->inodelk,
+ local->cont.inodelk.volume,
+ &local->loc, local->cont.inodelk.cmd,
+ &local->cont.inodelk.flock, 0);
+
+ if (!--call_count)
+ break;
+ }
+
+ return 0;
+}
int32_t
afr_inodelk_cbk (call_frame_t *frame, void *cookie,
@@ -2978,24 +3044,88 @@
{
afr_local_t *local = NULL;
+ afr_private_t *priv = NULL;
int call_count = -1;
+ int child_index = (long)cookie;
+ int i = 0;
+ int lock_count = 0;
local = frame->local;
+ priv = this->private;
- LOCK (&frame->lock);
- {
- if (op_ret == 0)
- local->op_ret = 0;
-
- local->op_errno = op_errno;
+ if (op_ret < 0)
+ local->child_errno[child_index] = op_errno;
+ if (op_ret == 0 && xdata) {
+ LOCK (&frame->lock);
+ {
+ if (!local->xdata_rsp)
+ local->xdata_rsp = dict_ref (xdata);
+ }
+ UNLOCK (&frame->lock);
}
- UNLOCK (&frame->lock);
call_count = afr_frame_return (frame);
- if (call_count == 0)
- AFR_STACK_UNWIND (inodelk, frame, local->op_ret,
- local->op_errno, xdata);
+ if (call_count == 0) {
+ for (i = 0; i < priv->child_count; i++) {
+ /*
+ * The idea is to not allow lock even if at least one of
+ * the bricks already have a competing lock granted. If
+ * there is a competing lock the errno returned is
+ * EAGAIN. so in this loop the following criteria
+ * should be met.
+ * 1) If the errno is anything other than EAGAIN
+ * on some of the subvols but there is at least one
+ * success, the fop should be considered success.
+ * 2) If the errno is EAGAIN on at least one of the
+ * subvols the fop should fail with -1, EAGAIN.
+ */
+ if (!local->child_up[i])
+ continue;
+
+ if (local->child_errno[i] == 0)
+ lock_count++;
+
+ if (local->op_ret == -1 && local->op_errno == EAGAIN)
+ continue;
+ /*
+ * For meeting '2)' we set op_ret to -1, op_errno to
+ * EAGAIN if any of the bricks give that error. Check
+ * above prevents any more modifications to
+ * local->op_ret, local->op_errno
+ * (i.e. final status of the fop).
+ */
+ if (local->child_errno[i] == EAGAIN) {
+ local->op_ret = -1;
+ local->op_errno = EAGAIN;
+ continue;
+ }
+
+ /*
+ * For meeting '1)'
+ * Here we set the op_ret to 0 if the fop succeeds on
+ * any of the bricks provided we haven't witnessed
+ * any -1, EAGAIN from other bricks. So if the bricks
+ * fail with some other reason other than EAGAIN but
+ * succeed on at least one of the bricks the final
+ * result is SUCCESS for the fop.
+ */
+
+ if (local->child_errno[i] == 0)
+ local->op_ret = 0;
+
+ local->op_errno = local->child_errno[i];
+ }
+
+ if (lock_count && local->cont.inodelk.flock.l_type != F_UNLCK &&
+ (local->op_ret == -1 && local->op_errno == EAGAIN)) {
+ afr_unlock_inodelks_and_unwind (frame, this,
+ lock_count);
+ } else {
+ AFR_STACK_UNWIND (inodelk, frame, local->op_ret,
+ local->op_errno, local->xdata_rsp);
+ }
+ }
return 0;
}
@@ -3026,14 +3156,20 @@
if (ret < 0)
goto out;
+ loc_copy (&local->loc, loc);
+ local->cont.inodelk.volume = volume;
+ local->cont.inodelk.cmd = cmd;
+ local->cont.inodelk.flock = *flock;
+
call_count = local->call_count;
for (i = 0; i < priv->child_count; i++) {
if (local->child_up[i]) {
- STACK_WIND (frame, afr_inodelk_cbk,
- priv->children[i],
- priv->children[i]->fops->inodelk,
- volume, loc, cmd, flock, xdata);
+ STACK_WIND_COOKIE (frame, afr_inodelk_cbk,
+ (void*) (long) i,
+ priv->children[i],
+ priv->children[i]->fops->inodelk,
+ volume, loc, cmd, flock, xdata);
if (!--call_count)
break;
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/cluster/afr/src/afr-self-heal-common.c
^
|
@@ -1508,6 +1508,8 @@
afr_self_heal_t *sh = NULL;
local = frame->local;
+ GF_ASSERT (local);
+
sh = &local->self_heal;
GF_ASSERT (sh->post_remove_call);
@@ -1567,7 +1569,7 @@
return;
out:
gf_log (this->name, GF_LOG_ERROR, "Expunge of %s failed, reason: %s",
- local->loc.path, strerror (op_errno));
+ local ? local->loc.path : "<unknown>" , strerror (op_errno));
expunge_done (frame, this, child_index, -1, op_errno);
}
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/cluster/afr/src/afr-self-heald.c
^
|
@@ -65,6 +65,18 @@
int
afr_syncop_find_child_position (void *data);
+void
+_destroy_shd_event_data (void *data)
+{
+ shd_event_t *event = NULL;
+ if (!data)
+ goto out;
+ event = (shd_event_t*)data;
+ GF_FREE (event->path);
+out:
+ return;
+}
+
static int
_loc_assign_gfid_path (loc_t *loc)
{
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/cluster/afr/src/afr.c
^
|
@@ -430,15 +430,18 @@
if (!priv->shd.timer)
goto out;
- priv->shd.healed = eh_new (AFR_EH_HEALED_LIMIT, _gf_false);
+ priv->shd.healed = eh_new (AFR_EH_HEALED_LIMIT, _gf_false,
+ _destroy_shd_event_data);
if (!priv->shd.healed)
goto out;
- priv->shd.heal_failed = eh_new (AFR_EH_HEAL_FAIL_LIMIT, _gf_false);
+ priv->shd.heal_failed = eh_new (AFR_EH_HEAL_FAIL_LIMIT, _gf_false,
+ _destroy_shd_event_data);
if (!priv->shd.heal_failed)
goto out;
- priv->shd.split_brain = eh_new (AFR_EH_SPLIT_BRAIN_LIMIT, _gf_false);
+ priv->shd.split_brain = eh_new (AFR_EH_SPLIT_BRAIN_LIMIT, _gf_false,
+ _destroy_shd_event_data);
if (!priv->shd.split_brain)
goto out;
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/cluster/afr/src/afr.h
^
|
@@ -646,6 +646,13 @@
dict_t *params;
char *linkpath;
} symlink;
+
+ struct {
+ const char *volume;
+ int32_t cmd;
+ struct gf_flock flock;
+ } inodelk;
+
} cont;
struct {
@@ -892,10 +899,12 @@
do { \
afr_local_t *__local = NULL; \
xlator_t *__this = NULL; \
- __local = frame->local; \
- __this = frame->this; \
- frame->local = NULL; \
- STACK_DESTROY (frame->root); \
+ if (frame) { \
+ __local = frame->local; \
+ __this = frame->this; \
+ frame->local = NULL; \
+ STACK_DESTROY (frame->root); \
+ } \
if (__local) { \
afr_local_cleanup (__local, __this); \
mem_put (__local); \
@@ -1052,6 +1061,8 @@
gf_boolean_t
afr_is_fd_fixable (fd_t *fd);
+void _destroy_shd_event_data (void *data);
+
void
afr_prepare_new_entry_pending_matrix (int32_t **pending,
gf_boolean_t (*is_pending) (int *, int),
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/cluster/dht/src/Makefile.am
^
|
@@ -21,7 +21,7 @@
switch_la_LDFLAGS = -module -avoid-version
switch_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la
-noinst_HEADERS = dht-common.h dht-mem-types.h \
+noinst_HEADERS = dht-common.h dht-mem-types.h dht-helper.h \
$(top_builddir)/xlators/lib/src/libxlator.h
AM_CPPFLAGS = $(GF_CPPFLAGS) -I$(top_srcdir)/libglusterfs/src \
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/cluster/dht/src/Makefile.in
^
|
@@ -316,7 +316,7 @@
nufa_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la
switch_la_LDFLAGS = -module -avoid-version
switch_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la
-noinst_HEADERS = dht-common.h dht-mem-types.h \
+noinst_HEADERS = dht-common.h dht-mem-types.h dht-helper.h \
$(top_builddir)/xlators/lib/src/libxlator.h
AM_CPPFLAGS = $(GF_CPPFLAGS) -I$(top_srcdir)/libglusterfs/src \
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/cluster/dht/src/dht-common.c
^
|
@@ -442,7 +442,8 @@
is_dir = check_is_dir (inode, stbuf, xattr);
if (!is_dir) {
gf_log (this->name, GF_LOG_DEBUG,
- "lookup of %s on %s returned non dir 0%o",
+ "lookup of %s on %s returned non dir 0%o "
+ "calling lookup_everywhere",
local->loc.path, prev->this->name,
stbuf->ia_type);
local->need_selfheal = 1;
@@ -541,6 +542,12 @@
LOCK (&frame->lock);
{
+
+ gf_log (this->name, GF_LOG_DEBUG,
+ "revalidate lookup of %s "
+ "returned with op_ret %d and op_errno %d",
+ local->loc.path, op_ret, op_errno);
+
if (op_ret == -1) {
local->op_errno = op_errno;
@@ -564,6 +571,14 @@
* the file is not migrated */
if (op_errno == ENOENT) {
if (IA_ISREG (local->loc.inode->ia_type)) {
+
+ gf_log (this->name, GF_LOG_DEBUG,
+ "found ENOENT for %s. "
+ "Setting "
+ "need_lookup_everywhere"
+ " flag to 1",
+ local->loc.path);
+
local->need_lookup_everywhere = 1;
}
}
@@ -760,9 +775,16 @@
}
unwind:
+ gf_log (this->name, GF_LOG_DEBUG,
+ "creation of linkto on hashed subvol:%s, "
+ "returned with op_ret %d and op_errno %d: %s",
+ local->hashed_subvol->name,
+ op_ret, op_errno, uuid_utoa (local->loc.gfid));
+
if (local->linked == _gf_true)
dht_linkfile_attr_heal (frame, this);
+
DHT_STRIP_PHASE1_FLAGS (&local->stbuf);
DHT_STACK_UNWIND (lookup, frame, local->op_ret, local->op_errno,
local->inode, &local->stbuf, local->xattr,
@@ -771,6 +793,176 @@
return ret;
}
+int
+dht_lookup_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int op_ret, int op_errno,
+ struct iatt *preparent, struct iatt *postparent,
+ dict_t *xdata)
+{
+ int this_call_cnt = 0;
+ dht_local_t *local = NULL;
+ const char *path = NULL;
+
+ local = (dht_local_t*)frame->local;
+ path = local->loc.path;
+
+ gf_log (this->name, GF_LOG_INFO, "lookup_unlink returned with "
+ "op_ret -> %d and op-errno -> %d for %s", op_ret, op_errno,
+ ((path == NULL)? "null" : path ));
+
+ this_call_cnt = dht_frame_return (frame);
+ if (is_last_call (this_call_cnt)) {
+ dht_lookup_everywhere_done (frame, this);
+ }
+
+ return 0;
+}
+
+int
+dht_lookup_unlink_of_false_linkto_cbk (call_frame_t *frame, void *cookie,
+ xlator_t *this, int op_ret, int op_errno,
+ struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata)
+{
+ int this_call_cnt = 0;
+ dht_local_t *local = NULL;
+ const char *path = NULL;
+
+ local = (dht_local_t*)frame->local;
+ path = local->loc.path;
+
+ gf_log (this->name, GF_LOG_INFO, "lookup_unlink returned with "
+ "op_ret -> %d and op-errno -> %d for %s", op_ret, op_errno,
+ ((path == NULL)? "null" : path ));
+
+ this_call_cnt = dht_frame_return (frame);
+ if (is_last_call (this_call_cnt)) {
+
+ if (op_ret == 0) {
+ dht_lookup_everywhere_done (frame, this);
+ } else {
+ /*When dht_lookup_everywhere is performed, one cached
+ *and one hashed file was found and hashed file does
+ *not point to the above mentioned cached node. So it
+ *was considered as stale and an unlink was performed.
+ *But unlink fails. So may be rebalance is in progress.
+ *now ideally we have two data-files. One obtained during
+ *lookup_everywhere and one where unlink-failed. So
+ *at this point in time we cannot decide which one to
+ *choose because there are chances of first cached
+ *file is truncated after rebalance and if it is choosen
+ *as cached node, application will fail. So return EIO.*/
+
+ if (op_errno == EBUSY) {
+
+ gf_log (this->name, GF_LOG_ERROR,
+ "Could not unlink the linkto file as "
+ "either fd is open and/or linkto xattr "
+ "is set for %s",
+ ((path == NULL)? "null":path));
+
+ }
+ DHT_STACK_UNWIND (lookup, frame, -1, EIO, NULL, NULL,
+ NULL, NULL);
+
+ }
+ }
+
+ return 0;
+}
+
+int
+dht_lookup_unlink_stale_linkto_cbk (call_frame_t *frame, void *cookie,
+ xlator_t *this, int op_ret, int op_errno,
+ struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata)
+{
+
+ dht_local_t *local = NULL;
+ const char *path = NULL;
+
+ /* NOTE:
+ * If stale file unlink fails either there is an open-fd or is not an
+ * dht-linkto-file then posix_unlink returns EBUSY, which is overwritten
+ * to ENOENT
+ */
+
+ local = frame->local;
+
+ if (local && local->loc.path)
+ path = local->loc.path;
+
+ gf_log (this->name, GF_LOG_INFO, "Returned with op_ret %d and "
+ "op_errno %d for %s", op_ret, op_errno,
+ ((path==NULL)?"null":path));
+
+ DHT_STACK_UNWIND (lookup, frame, -1, ENOENT, NULL, NULL, NULL,
+ NULL);
+
+ return 0;
+}
+
+int
+dht_fill_dict_to_avoid_unlink_of_migrating_file (dict_t *dict) {
+
+ int ret = 0;
+
+ ret = dict_set_int32 (dict, DHT_SKIP_NON_LINKTO_UNLINK, 1);
+
+ if (ret)
+ goto err;
+
+ ret = dict_set_int32 (dict, DHT_SKIP_OPEN_FD_UNLINK, 1);
+
+ if (ret)
+ goto err;
+
+
+ return 0;
+
+err:
+ return -1;
+
+}
+/* Rebalance is performed from cached_node to hashed_node. Initial cached_node
+ * contains a non-linkto file. After migration it is converted to linkto and
+ * then unlinked. And at hashed_subvolume, first a linkto file is present,
+ * then after migration it is converted to a non-linkto file.
+ *
+ * Lets assume a file is present on cached subvolume and a new brick is added
+ * and new brick is the new_hashed subvolume. So fresh lookup on newly added
+ * hashed subvolume will fail and dht_lookup_everywhere gets called. If just
+ * before sending the dht_lookup_everywhere request rebalance is in progress,
+ *
+ * from cached subvolume it may see: Nonlinkto or linkto or No file
+ * from hashed subvolume it may see: No file or linkto file or non-linkto file
+ *
+ * So this boils down to 9 cases:
+ * at cached_subvol at hashed_subvol
+ * ---------------- -----------------
+ *
+ *a) No file No file
+ * [request reached after [Request reached before
+ * migration] Migration]
+ *
+ *b) No file Linkto File
+ *
+ *c) No file Non-Linkto File
+ *
+ *d) Linkto No-File
+ *
+ *e) Linkto Linkto
+ *
+ *f) Linkto Non-Linkto
+ *
+ *g) NonLinkto No-File
+ *
+ *h) NonLinkto Linkto
+ *
+ *i) NonLinkto NonLinkto
+ *
+ * dht_lookup_everywhere_done takes decision based on any of the above case
+ */
int
dht_lookup_everywhere_done (call_frame_t *frame, xlator_t *this)
@@ -780,6 +972,7 @@
xlator_t *hashed_subvol = NULL;
xlator_t *cached_subvol = NULL;
dht_layout_t *layout = NULL;
+ gf_boolean_t found_non_linkto_on_hashed = _gf_false;
local = frame->local;
hashed_subvol = local->hashed_subvol;
@@ -801,19 +994,210 @@
return 0;
}
+ gf_log (this->name, GF_LOG_INFO, "STATUS: hashed_subvol %s "
+ "cached_subvol %s",
+ (hashed_subvol == NULL)?"null":hashed_subvol->name,
+ (cached_subvol == NULL)?"null":cached_subvol->name);
+
if (!cached_subvol) {
- DHT_STACK_UNWIND (lookup, frame, -1, ENOENT, NULL, NULL, NULL,
- NULL);
+
+ if (local->skip_unlink.handle_valid_link && hashed_subvol) {
+
+ /*Purpose of "DHT_SKIP_NON_LINKTO_UNLINK":
+ * If this lookup is performed by rebalance and this
+ * rebalance process detected hashed file and by
+ * the time it sends the lookup request to cached node,
+ * file got migrated and now at intial hashed_node,
+ * final migrated file is present. With current logic,
+ * because this process fails to find the cached_node,
+ * it will unlink the file at initial hashed_node.
+ *
+ * So we avoid this by setting key, and checking at the
+ * posix_unlink that unlink the file only if file is a
+ * linkto file and not a migrated_file.
+ */
+
+
+ ret = dht_fill_dict_to_avoid_unlink_of_migrating_file
+ (local->xattr_req);
+
+ if (ret) {
+ /* If for some reason, setting key in the dict
+ * fails, return with ENOENT, as with respect to
+ * this process, it detected only a stale link
+ * file.
+ *
+ * Next lookup will delete it.
+ *
+ * Performing deletion of stale link file when
+ * setting key in dict fails, may cause the data
+ * loss becase of the above mentioned race.
+ */
+
+
+ DHT_STACK_UNWIND (lookup, frame, -1, ENOENT,
+ NULL, NULL, NULL, NULL);
+ } else {
+ local->skip_unlink.handle_valid_link = _gf_false;
+
+ gf_log (this->name, GF_LOG_DEBUG,
+ "No Cached was found and "
+ "unlink on hashed was skipped"
+ " so performing now: %s",
+ local->loc.path);
+
+ STACK_WIND (frame,
+ dht_lookup_unlink_stale_linkto_cbk,
+ hashed_subvol,
+ hashed_subvol->fops->unlink,
+ &local->loc, 0, local->xattr_req);
+ }
+
+ } else {
+ gf_log (this->name, GF_LOG_DEBUG,
+ "There was no cached file and "
+ "unlink on hashed is not skipped %s",
+ local->loc.path);
+
+ DHT_STACK_UNWIND (lookup, frame, -1, ENOENT, NULL, NULL,
+ NULL, NULL);
+ }
return 0;
}
- if (local->need_lookup_everywhere) {
- if (uuid_compare (local->gfid, local->inode->gfid)) {
- /* GFID different, return error */
- DHT_STACK_UNWIND (lookup, frame, -1, ENOENT, NULL,
- NULL, NULL, NULL);
- return 0;
+ /* At the time of dht_lookup, no file was found on hashed and that is
+ * why dht_lookup_everywhere is called, but by the time
+ * dht_lookup_everywhere
+ * reached to server, file might have already migrated. In that case we
+ * will find a migrated file at the hashed_node. In this case store the
+ * layout in context and return successfully.
+ */
+
+ if (hashed_subvol || local->need_lookup_everywhere) {
+
+ if (local->need_lookup_everywhere) {
+
+ found_non_linkto_on_hashed = _gf_true;
+
+ } else if ((local->file_count == 1) &&
+ (hashed_subvol == cached_subvol)) {
+
+ gf_log (this->name, GF_LOG_DEBUG,
+ "found cached file on hashed subvolume "
+ "so store in context and return for %s",
+ local->loc.path);
+
+ found_non_linkto_on_hashed = _gf_true;
+ }
+
+ if (found_non_linkto_on_hashed)
+ goto preset_layout;
+
+ }
+
+
+ if (hashed_subvol) {
+ if (local->skip_unlink.handle_valid_link == _gf_true) {
+ if (cached_subvol == local->skip_unlink.hash_links_to) {
+
+ if (uuid_compare (local->skip_unlink.cached_gfid,
+ local->skip_unlink.hashed_gfid)){
+
+ /*GFID different, return error*/
+ DHT_STACK_UNWIND (lookup, frame, -1,
+ ESTALE, NULL, NULL, NULL,
+ NULL);
+
+
+ }
+
+ ret = dht_layout_preset (this, cached_subvol,
+ local->loc.inode);
+ if (ret) {
+ gf_log (this->name, GF_LOG_INFO,
+ "Could not set pre-set layout "
+ "for subvolume %s",
+ cached_subvol->name);
+ }
+
+ local->op_ret = (ret == 0) ? ret : -1;
+ local->op_errno = (ret == 0) ? ret : EINVAL;
+
+ /* Presence of local->cached_subvol validates
+ * that lookup from cached node is successful
+ */
+
+ if (!local->op_ret && local->loc.parent) {
+ dht_inode_ctx_time_update
+ (local->loc.parent, this,
+ &local->postparent, 1);
+ }
+
+ gf_log (this->name, GF_LOG_DEBUG,
+ "Skipped unlinking linkto file "
+ "on the hashed subvolume. "
+ "Returning success as it is a "
+ "valid linkto file. Path:%s"
+ ,local->loc.path);
+
+ goto unwind_hashed_and_cached;
+ } else {
+
+ local->skip_unlink.handle_valid_link = _gf_false;
+
+ gf_log (this->name, GF_LOG_DEBUG,
+ "Linkto file found on hashed "
+ "subvol "
+ "and data file found on cached "
+ "subvolume. But linkto points to "
+ "different cached subvolume (%s) "
+ "path %s",
+ local->skip_unlink.hash_links_to->name,
+ local->loc.path);
+
+ if (local->skip_unlink.opend_fd_count == 0) {
+
+
+ ret = dht_fill_dict_to_avoid_unlink_of_migrating_file
+ (local->xattr_req);
+
+
+ if (ret) {
+ DHT_STACK_UNWIND (lookup, frame, -1,
+ EIO, NULL, NULL,
+ NULL, NULL);
+ } else {
+ local->call_cnt = 1;
+ STACK_WIND (frame,
+ dht_lookup_unlink_of_false_linkto_cbk,
+ hashed_subvol,
+ hashed_subvol->fops->unlink,
+ &local->loc, 0,
+ local->xattr_req);
+ }
+
+ return 0;
+
+ }
+ }
+
}
+ }
+
+
+preset_layout:
+
+ if (found_non_linkto_on_hashed) {
+
+ if (local->need_lookup_everywhere) {
+ if (uuid_compare (local->gfid, local->inode->gfid)) {
+ /* GFID different, return error */
+ DHT_STACK_UNWIND (lookup, frame, -1, ENOENT,
+ NULL, NULL, NULL, NULL);
+ return 0;
+ }
+ }
+
local->op_ret = 0;
local->op_errno = 0;
layout = dht_layout_for_subvol (this, cached_subvol);
@@ -890,26 +1274,15 @@
cached_subvol, hashed_subvol, &local->loc);
return ret;
-}
-
-
-int
-dht_lookup_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno,
- struct iatt *preparent, struct iatt *postparent,
- dict_t *xdata)
-{
- int this_call_cnt = 0;
-
- this_call_cnt = dht_frame_return (frame);
- if (is_last_call (this_call_cnt)) {
- dht_lookup_everywhere_done (frame, this);
- }
+unwind_hashed_and_cached:
+ DHT_STRIP_PHASE1_FLAGS (&local->stbuf);
+ DHT_STACK_UNWIND (lookup, frame, local->op_ret, local->op_errno,
+ local->loc.inode, &local->stbuf, local->xattr,
+ &local->postparent);
return 0;
}
-
int
dht_lookup_everywhere_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
@@ -924,8 +1297,9 @@
xlator_t *subvol = NULL;
loc_t *loc = NULL;
xlator_t *link_subvol = NULL;
- int ret = -1;
- int32_t fd_count = 0;
+ int ret = -1;
+ int32_t fd_count = 0;
+ dict_t *dict_req = {0};
GF_VALIDATE_OR_GOTO ("dht", frame, out);
GF_VALIDATE_OR_GOTO ("dht", this, out);
@@ -939,6 +1313,11 @@
prev = cookie;
subvol = prev->this;
+ gf_log (this->name, GF_LOG_DEBUG,
+ "returned with op_ret %d and op_errno %d (%s) "
+ "from subvol %s", op_ret, op_errno, loc->path,
+ subvol->name);
+
LOCK (&frame->lock);
{
if (op_ret == -1) {
@@ -957,6 +1336,13 @@
}
is_linkfile = check_is_linkfile (inode, buf, xattr);
+ if (is_linkfile) {
+ gf_log (this->name, GF_LOG_DEBUG,
+ "Found linktofile on %s for %s",
+ subvol->name, loc->path);
+
+ }
+
is_dir = check_is_dir (inode, buf, xattr);
if (is_linkfile) {
@@ -981,18 +1367,26 @@
} else {
local->file_count++;
+ gf_log (this->name, GF_LOG_DEBUG,
+ "found cached file on %s for %s",
+ subvol->name, loc->path);
+
if (!local->cached_subvol) {
/* found one file */
dht_iatt_merge (this, &local->stbuf, buf,
subvol);
local->xattr = dict_ref (xattr);
local->cached_subvol = subvol;
+
gf_log (this->name, GF_LOG_DEBUG,
- "found on %s file %s",
+ "datafile found on %s file %s",
subvol->name, loc->path);
dht_iatt_merge (this, &local->postparent,
postparent, subvol);
+
+ uuid_copy (local->skip_unlink.cached_gfid,
+ buf->ia_gfid);
} else {
/* This is where we need 'rename' both entries logic */
gf_log (this->name, GF_LOG_WARNING,
@@ -1009,15 +1403,68 @@
if (is_linkfile) {
ret = dict_get_int32 (xattr, GLUSTERFS_OPEN_FD_COUNT, &fd_count);
- /* Delete the linkfile only if there are no open fds on it.
- if there is a open-fd, it may be in migration */
- if (!ret && (fd_count == 0)) {
- gf_log (this->name, GF_LOG_INFO,
- "deleting stale linkfile %s on %s",
- loc->path, subvol->name);
- STACK_WIND (frame, dht_lookup_unlink_cbk,
- subvol, subvol->fops->unlink, loc, 0, NULL);
- return 0;
+
+ /* Any linkto file found on the non-hashed subvolume should
+ * be unlinked (performed in the "else if" block below)
+ *
+ * But if a linkto file is found on hashed subvolume, it may be
+ * pointing to vaild cached node. So unlinking of linkto
+ * file on hashed subvolume is skipped and inside
+ * dht_lookup_everywhere_done, checks are performed. If this
+ * linkto file is found as stale linkto file, it is deleted
+ * otherwise unlink is skipped.
+ */
+
+ if (local->hashed_subvol && local->hashed_subvol == subvol) {
+
+ local->skip_unlink.handle_valid_link = _gf_true;
+ local->skip_unlink.opend_fd_count = fd_count;
+ local->skip_unlink.hash_links_to = link_subvol;
+ uuid_copy (local->skip_unlink.hashed_gfid,
+ buf->ia_gfid);
+
+ gf_log (this->name, GF_LOG_DEBUG, "Found"
+ " one linkto file on hashed subvol %s "
+ "for %s: Skipping unlinking till "
+ "everywhere_done", subvol->name,
+ loc->path);
+
+ } else if (!ret && (fd_count == 0)) {
+
+ dict_req = dict_new ();
+
+ ret = dht_fill_dict_to_avoid_unlink_of_migrating_file
+ (dict_req);
+
+ if (ret) {
+
+ /* Skip unlinking for dict_failure
+ *File is found as a linkto file on non-hashed,
+ *subvolume. In the current implementation,
+ *finding a linkto-file on non-hashed does not
+ *always implies that it is stale. So deletion
+ *of file should be done only when both fd is
+ *closed and linkto-xattr is set. In case of
+ *dict_set failure, avoid skipping of file.
+ *NOTE: dht_frame_return should get called for
+ * this block.
+ */
+
+ dict_unref (dict_req);
+
+ } else {
+ gf_log (this->name, GF_LOG_INFO,
+ "attempting deletion of stale linkfile "
+ "%s on %s", loc->path, subvol->name);
+
+ STACK_WIND (frame, dht_lookup_unlink_cbk,
+ subvol, subvol->fops->unlink, loc,
+ 0, dict_req);
+
+ dict_unref (dict_req);
+
+ return 0;
+ }
}
}
@@ -1054,6 +1501,9 @@
if (!local->inode)
local->inode = inode_ref (loc->inode);
+ gf_log (this->name, GF_LOG_DEBUG,
+ "winding lookup call to %d subvols", call_cnt);
+
for (i = 0; i < call_cnt; i++) {
STACK_WIND (frame, dht_lookup_everywhere_cbk,
conf->subvolumes[i],
@@ -1252,9 +1702,14 @@
if (!op_ret && uuid_is_null (local->gfid))
memcpy (local->gfid, stbuf->ia_gfid, 16);
+ gf_log (this->name, GF_LOG_DEBUG,
+ "fresh_lookup returned for %s with op_ret %d and "
+ "op_errno %d", loc->path, op_ret, op_errno);
+
if (ENTRY_MISSING (op_ret, op_errno)) {
gf_log (this->name, GF_LOG_TRACE, "Entry %s missing on subvol"
" %s", loc->path, prev->this->name);
+
if (conf->search_unhashed == GF_DHT_LOOKUP_UNHASHED_ON) {
local->op_errno = ENOENT;
dht_lookup_everywhere (frame, this, loc);
@@ -1313,13 +1768,17 @@
subvol = dht_linkfile_subvol (this, inode, stbuf, xattr);
if (!subvol) {
- gf_log (this->name, GF_LOG_DEBUG,
- "linkfile not having link subvolume. path=%s",
- loc->path);
+ gf_log (this->name, GF_LOG_INFO, "linkfile not having link "
+ "subvol for %s", loc->path);
+
dht_lookup_everywhere (frame, this, loc);
return 0;
}
+ gf_log (this->name, GF_LOG_DEBUG,
+ "Calling lookup on linkto target %s for path %s",
+ subvol->name, loc->path);
+
STACK_WIND (frame, dht_lookup_linkfile_cbk,
subvol, subvol->fops->lookup,
&local->loc, local->xattr_req);
@@ -1465,16 +1924,39 @@
dht_layout_unref (this, local->layout);
local->layout = NULL;
local->cached_subvol = NULL;
+
+ gf_log (this->name, GF_LOG_WARNING,
+ "Called revalidate lookup for %s, "
+ "but layout->gen (%d) is less than "
+ "conf->gen (%d), calling fresh_lookup",
+ loc->path, layout->gen, conf->gen);
+
goto do_fresh_lookup;
}
local->inode = inode_ref (loc->inode);
- /* NOTE: we don't require 'trusted.glusterfs.dht.linkto' attribute,
- * revalidates directly go to the cached-subvolume.
- */
ret = dict_set_uint32 (local->xattr_req,
"trusted.glusterfs.dht", 4 * 4);
+ if (ret) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "Failed to set dictionary value:"
+ "key = trusted.glusterfs.dht for "
+ "path %s", loc->path);
+ goto err;
+ }
+
+ /* need it in case file is not found on cached file
+ * on revalidate path and we may encounter linkto files on
+ * with dht_lookup_everywhere*/
+ ret = dict_set_uint32 (local->xattr_req, DHT_LINKFILE_KEY, 256);
+ if (ret < 0) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "Failed to set dictionary value:"
+ "key = %s for "
+ "path %s", DHT_LINKFILE_KEY, loc->path);
+ goto err;
+ }
if (IA_ISDIR (local->inode->ia_type)) {
local->call_cnt = call_cnt = conf->subvolume_cnt;
@@ -1493,13 +1975,22 @@
'in-migration' state */
ret = dict_set_uint32 (local->xattr_req,
GLUSTERFS_OPEN_FD_COUNT, 4);
-
+ if (ret) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "Failed to set dictionary value:key = %s for "
+ "path %s", GLUSTERFS_OPEN_FD_COUNT, loc->path);
+ goto err;
+ }
/* need it for dir self-heal */
dht_check_and_set_acl_xattr_req (loc->inode, local->xattr_req);
for (i = 0; i < call_cnt; i++) {
subvol = layout->list[i].xlator;
+ gf_log (this->name, GF_LOG_DEBUG, "calling "
+ "revalidate lookup for %s at %s",
+ loc->path, subvol->name);
+
STACK_WIND (frame, dht_revalidate_cbk,
subvol, subvol->fops->lookup,
&local->loc, local->xattr_req);
@@ -1510,15 +2001,32 @@
/* TODO: remove the hard-coding */
ret = dict_set_uint32 (local->xattr_req,
"trusted.glusterfs.dht", 4 * 4);
+ if (ret) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "Failed to set dictionary value:key = %s for "
+ "path %s", "trusted.glusterfs.dht", loc->path);
+ goto err;
+ }
ret = dict_set_uint32 (local->xattr_req,
DHT_LINKFILE_KEY, 256);
+ if (ret) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "Failed to set dictionary value:key = %s for "
+ "path %s", DHT_LINKFILE_KEY, loc->path);
+ goto err;
+ }
/* need it for self-healing linkfiles which is
'in-migration' state */
ret = dict_set_uint32 (local->xattr_req,
GLUSTERFS_OPEN_FD_COUNT, 4);
-
+ if (ret) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "Failed to set dictionary value:key = %s for "
+ "path %s", GLUSTERFS_OPEN_FD_COUNT, loc->path);
+ goto err;
+ }
/* need it for dir self-heal */
dht_check_and_set_acl_xattr_req (loc->inode, local->xattr_req);
@@ -1527,6 +2035,7 @@
"no subvolume in layout for path=%s, "
"checking on all the subvols to see if "
"it is a directory", loc->path);
+
call_cnt = conf->subvolume_cnt;
local->call_cnt = call_cnt;
@@ -1537,6 +2046,10 @@
goto err;
}
+ gf_log (this->name, GF_LOG_DEBUG,
+ "Found null hashed subvol. Calling lookup"
+ " on all nodes.");
+
for (i = 0; i < call_cnt; i++) {
STACK_WIND (frame, dht_lookup_dir_cbk,
conf->subvolumes[i],
@@ -1546,6 +2059,10 @@
return 0;
}
+ gf_log (this->name, GF_LOG_DEBUG,
+ "Calling fresh lookup for %s on"
+ " %s", loc->path, hashed_subvol->name);
+
STACK_WIND (frame, dht_lookup_cbk,
hashed_subvol, hashed_subvol->fops->lookup,
loc, local->xattr_req);
@@ -2062,10 +2579,8 @@
{
int this_call_cnt = 0;
dht_local_t *local = NULL;
- dht_conf_t *conf = NULL;
- conf = this->private;
local = frame->local;
if (op_ret != -1) {
@@ -2092,7 +2607,6 @@
dht_getxattr_get_real_filename (call_frame_t *frame, xlator_t *this,
loc_t *loc, const char *key, dict_t *xdata)
{
- dht_conf_t *conf = NULL;
dht_local_t *local = NULL;
int i = 0;
dht_layout_t *layout = NULL;
@@ -2100,7 +2614,6 @@
xlator_t *subvol = NULL;
- conf = this->private;
local = frame->local;
layout = local->layout;
@@ -3039,7 +3552,6 @@
return 0;
}
-
int
dht_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
int op_errno, gf_dirent_t *orig_entries, dict_t *xdata)
@@ -3055,7 +3567,9 @@
dht_layout_t *layout = 0;
dht_conf_t *conf = NULL;
xlator_t *subvol = 0;
+ xlator_t *hashed_subvol = 0;
int ret = 0;
+ int readdir_optimize = 0;
INIT_LIST_HEAD (&entries.list);
prev = cookie;
@@ -3070,15 +3584,47 @@
layout = local->layout;
+ if (conf->readdir_optimize == _gf_true)
+ readdir_optimize = 1;
+
list_for_each_entry (orig_entry, (&orig_entries->list), list) {
next_offset = orig_entry->d_off;
- if ((check_is_dir (NULL, (&orig_entry->d_stat), NULL) &&
- (prev->this != local->first_up_subvol)) ||
- check_is_linkfile (NULL, (&orig_entry->d_stat),
+ if (check_is_dir (NULL, (&orig_entry->d_stat), NULL)) {
+
+ /*Directory entries filtering :
+ * a) If rebalance is running, pick from first_up_subvol
+ * b) (rebalance not running)hashed subvolume is NULL or
+ * down then filter in first_up_subvolume. Other wise the
+ * corresponding hashed subvolume will take care of the
+ * directory entry.
+ */
+
+ if (readdir_optimize) {
+ if (prev->this == local->first_up_subvol)
+ goto list;
+ else
+ continue;
+
+ }
+
+ hashed_subvol = dht_layout_search (this, layout, \
+ orig_entry->d_name);
+
+ if (prev->this == hashed_subvol)
+ goto list;
+ if ((hashed_subvol
+ && dht_subvol_status (conf, hashed_subvol))
+ ||(prev->this != local->first_up_subvol))
+ continue;
+
+ goto list;
+ }
+
+ if (check_is_linkfile (NULL, (&orig_entry->d_stat),
orig_entry->dict)) {
continue;
}
-
+list:
entry = gf_dirent_for_name (orig_entry->d_name);
if (!entry) {
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/cluster/dht/src/dht-common.h
^
|
@@ -24,6 +24,7 @@
#define GF_DHT_LOOKUP_UNHASHED_ON 1
#define GF_DHT_LOOKUP_UNHASHED_AUTO 2
#define DHT_PATHINFO_HEADER "DISTRIBUTE:"
+#define DHT_FILE_MIGRATE_DOMAIN "dht.file.migrate"
#include <fnmatch.h>
@@ -96,6 +97,25 @@
dict_t *xdata;
};
+struct dht_skip_linkto_unlink {
+
+ gf_boolean_t handle_valid_link;
+ int opend_fd_count;
+ xlator_t *hash_links_to;
+ uuid_t cached_gfid;
+ uuid_t hashed_gfid;
+};
+
+typedef struct {
+ xlator_t *xl;
+ loc_t loc; /* contains/points to inode to lock on. */
+ short type; /* read/write lock. */
+ char *domain; /* Only locks within a single domain
+ * contend with each other
+ */
+ gf_boolean_t locked;
+} dht_lock_t;
+
struct dht_local {
int call_cnt;
loc_t loc;
@@ -183,6 +203,20 @@
struct dht_rebalance_ rebalance;
xlator_t *first_up_subvol;
+ gf_boolean_t added_link;
+ gf_boolean_t is_linkfile;
+
+ struct dht_skip_linkto_unlink skip_unlink;
+
+ struct {
+ fop_inodelk_cbk_t inodelk_cbk;
+ dht_lock_t **locks;
+ int lk_count;
+
+ /* whether locking failed on _any_ of the "locks" above */
+ int op_ret;
+ int op_errno;
+ } lock;
};
typedef struct dht_local dht_local_t;
@@ -277,6 +311,7 @@
/* Request to filter directory entries in readdir request */
gf_boolean_t readdir_optimize;
+ struct mem_pool *lock_pool;
};
typedef struct dht_conf dht_conf_t;
@@ -420,6 +455,7 @@
xlator_t *dht_subvol_get_hashed (xlator_t *this, loc_t *loc);
xlator_t *dht_subvol_get_cached (xlator_t *this, inode_t *inode);
xlator_t *dht_subvol_next (xlator_t *this, xlator_t *prev);
+xlator_t *dht_subvol_next_available (xlator_t *this, xlator_t *prev);
int dht_subvol_cnt (xlator_t *this, xlator_t *subvol);
int dht_hash_compute (int type, const char *name, uint32_t *hash_p);
@@ -460,11 +496,11 @@
xlator_t **subvol);
int dht_rename_cleanup (call_frame_t *frame);
-int dht_rename_links_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno,
- inode_t *inode, struct iatt *stbuf,
- struct iatt *preparent, struct iatt *postparent,
- dict_t *xdata);
+int dht_rename_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno,
+ inode_t *inode, struct iatt *stbuf,
+ struct iatt *preparent, struct iatt *postparent,
+ dict_t *xdata);
int dht_fix_directory_layout (call_frame_t *frame,
dht_selfheal_dir_cbk_t dir_cbk,
@@ -740,4 +776,61 @@
dht_layout_t *layout);
int
dht_linkfile_attr_heal (call_frame_t *frame, xlator_t *this);
+
+void
+dht_layout_dump (dht_layout_t *layout, const char *prefix);
+int32_t
+dht_priv_dump (xlator_t *this);
+int32_t
+dht_inodectx_dump (xlator_t *this, inode_t *inode);
+
+int
+dht_subvol_status (dht_conf_t *conf, xlator_t *subvol);
+
+void
+dht_log_new_layout_for_dir_selfheal (xlator_t *this, loc_t *loc,
+ dht_layout_t *layout);
+int
+dht_lookup_everywhere_done (call_frame_t *frame, xlator_t *this);
+
+int
+dht_fill_dict_to_avoid_unlink_of_migrating_file (dict_t *dict);
+
+
+/* Acquire non-blocking inodelk on a list of xlators.
+ *
+ * @lk_array: array of lock requests lock on.
+ *
+ * @lk_count: number of locks in @lk_array
+ *
+ * @inodelk_cbk: will be called after inodelk replies are received
+ *
+ * @retval: -1 if stack_winding inodelk fails. 0 otherwise.
+ * inodelk_cbk is called with appropriate error on errors.
+ * On failure to acquire lock on all members of list, successful
+ * locks are unlocked before invoking cbk.
+ */
+
+int
+dht_nonblocking_inodelk (call_frame_t *frame, dht_lock_t **lk_array,
+ int lk_count, fop_inodelk_cbk_t inodelk_cbk);
+
+/* same as dht_nonblocking_inodelk, but issues sequential blocking locks on
+ * @lk_array directly. locks are issued on some order which remains same
+ * for a list of xlators (irrespective of order of xlators within list).
+ */
+int
+dht_blocking_inodelk (call_frame_t *frame, dht_lock_t **lk_array,
+ int lk_count, fop_inodelk_cbk_t inodelk_cbk);
+
+int32_t
+dht_unlock_inodelk (call_frame_t *frame, dht_lock_t **lk_array, int lk_count,
+ fop_inodelk_cbk_t inodelk_cbk);
+
+dht_lock_t *
+dht_lock_new (xlator_t *this, xlator_t *xl, loc_t *loc, short type,
+ const char *domain);
+void
+dht_lock_array_free (dht_lock_t **lk_array, int count);
+
#endif/* _DHT_H */
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/cluster/dht/src/dht-helper.c
^
|
@@ -17,6 +17,7 @@
#include "glusterfs.h"
#include "xlator.h"
#include "dht-common.h"
+#include "dht-helper.h"
int
@@ -234,6 +235,164 @@
return 0;
}
+char *
+dht_lock_asprintf (dht_lock_t *lock)
+{
+ char *lk_buf = NULL;
+ char gfid[GF_UUID_BUF_SIZE] = {0, };
+
+ if (lock == NULL)
+ goto out;
+
+ uuid_utoa_r (lock->loc.gfid, gfid);
+
+ gf_asprintf (&lk_buf, "%s:%s", lock->xl->name, gfid);
+
+out:
+ return lk_buf;
+}
+
+void
+dht_log_lk_array (char *name, gf_loglevel_t log_level, dht_lock_t **lk_array,
+ int count)
+{
+ int i = 0;
+ char *lk_buf = NULL;
+
+ if ((lk_array == NULL) || (count == 0))
+ goto out;
+
+ for (i = 0; i < count; i++) {
+ lk_buf = dht_lock_asprintf (lk_array[i]);
+ gf_log (name, log_level, "%d. %s", i, lk_buf);
+ GF_FREE (lk_buf);
+ }
+
+out:
+ return;
+}
+
+void
+dht_lock_stack_destroy (call_frame_t *lock_frame)
+{
+ dht_local_t *local = NULL;
+
+ local = lock_frame->local;
+
+ local->lock.locks = NULL;
+ local->lock.lk_count = 0;
+
+ DHT_STACK_DESTROY (lock_frame);
+ return;
+}
+
+void
+dht_lock_free (dht_lock_t *lock)
+{
+ if (lock == NULL)
+ goto out;
+
+ loc_wipe (&lock->loc);
+ GF_FREE (lock->domain);
+ mem_put (lock);
+
+out:
+ return;
+}
+
+void
+dht_lock_array_free (dht_lock_t **lk_array, int count)
+{
+ int i = 0;
+ dht_lock_t *lock = NULL;
+
+ if (lk_array == NULL)
+ goto out;
+
+ for (i = 0; i < count; i++) {
+ lock = lk_array[i];
+ lk_array[i] = NULL;
+ dht_lock_free (lock);
+ }
+
+out:
+ return;
+}
+
+dht_lock_t *
+dht_lock_new (xlator_t *this, xlator_t *xl, loc_t *loc, short type,
+ const char *domain)
+{
+ dht_conf_t *conf = NULL;
+ dht_lock_t *lock = NULL;
+
+ conf = this->private;
+
+ lock = mem_get0 (conf->lock_pool);
+ if (lock == NULL)
+ goto out;
+
+ lock->xl = xl;
+ lock->type = type;
+ lock->domain = gf_strdup (domain);
+ if (lock->domain == NULL) {
+ dht_lock_free (lock);
+ lock = NULL;
+ goto out;
+ }
+
+ /* Fill only inode and gfid.
+ posix and protocol/server give preference to pargfid/basename over
+ gfid/inode for resolution if all the three parameters of loc_t are
+ present. I want to avoid the following hypothetical situation:
+
+ 1. rebalance did a lookup on a dentry and got a gfid.
+ 2. rebalance acquires lock on loc_t which was filled with gfid and
+ path (pargfid/bname) from step 1.
+ 3. somebody deleted and recreated the same file
+ 4. rename on the same path acquires lock on loc_t which now points
+ to a different inode (and hence gets the lock).
+ 5. rebalance continues to migrate file (note that not all fops done
+ by rebalance during migration are inode/gfid based Eg., unlink)
+ 6. rename continues.
+ */
+ lock->loc.inode = inode_ref (loc->inode);
+ loc_gfid (loc, lock->loc.gfid);
+
+out:
+ return lock;
+}
+
+int
+dht_local_lock_init (call_frame_t *frame, dht_lock_t **lk_array,
+ int lk_count, fop_inodelk_cbk_t inodelk_cbk)
+{
+ int ret = -1;
+ dht_local_t *local = NULL;
+
+ local = frame->local;
+
+ if (local == NULL) {
+ local = dht_local_init (frame, NULL, NULL, 0);
+ }
+
+ if (local == NULL) {
+ goto out;
+ }
+
+ local->lock.inodelk_cbk = inodelk_cbk;
+ local->lock.locks = lk_array;
+ local->lock.lk_count = lk_count;
+
+ ret = dht_lock_order_requests (local->lock.locks,
+ local->lock.lk_count);
+ if (ret < 0)
+ goto out;
+
+ ret = 0;
+out:
+ return ret;
+}
void
dht_local_wipe (xlator_t *this, dht_local_t *local)
@@ -281,6 +440,9 @@
local->selfheal.layout = NULL;
}
+ dht_lock_array_free (local->lock.locks, local->lock.lk_count);
+ GF_FREE (local->lock.locks);
+
GF_FREE (local->newpath);
GF_FREE (local->key);
@@ -505,7 +667,36 @@
return next;
}
+/* This func wraps around, if prev is actually the last subvol.
+ */
+xlator_t *
+dht_subvol_next_available (xlator_t *this, xlator_t *prev)
+{
+ dht_conf_t *conf = NULL;
+ int i = 0;
+ xlator_t *next = NULL;
+
+ conf = this->private;
+ if (!conf)
+ goto out;
+ for (i = 0; i < conf->subvolume_cnt; i++) {
+ if (conf->subvolumes[i] == prev) {
+ /* if prev is last in conf->subvolumes, then wrap
+ * around.
+ */
+ if ((i + 1) < conf->subvolume_cnt) {
+ next = conf->subvolumes[i + 1];
+ } else {
+ next = conf->subvolumes[0];
+ }
+ break;
+ }
+ }
+
+out:
+ return next;
+}
int
dht_subvol_cnt (xlator_t *this, xlator_t *subvol)
{
@@ -802,13 +993,10 @@
if (!local->fd)
goto out;
/* once we detect the migration complete, the fd-ctx is no more
- required.. delete the ctx, and do one extra 'fd_unref' for open fd */
+ required.. delete the ctx */
ret = fd_ctx_del (local->fd, this, NULL);
- if (!ret) {
- fd_unref (local->fd);
- ret = 0;
+ if (!ret)
goto out;
- }
/* perform open as root:root. There is window between linkfile
* creation(root:root) and setattr with the correct uid/gid
@@ -1076,3 +1264,426 @@
out:
return ret;
}
+
+int
+dht_subvol_status (dht_conf_t *conf, xlator_t *subvol)
+{
+ int i;
+
+ for (i=0 ; i < conf->subvolume_cnt; i++) {
+ if (conf->subvolumes[i] == subvol) {
+ return conf->subvolume_status[i];
+ }
+ }
+ return 0;
+}
+
+void
+dht_inodelk_done (call_frame_t *lock_frame)
+{
+ fop_inodelk_cbk_t inodelk_cbk = NULL;
+ call_frame_t *main_frame = NULL;
+ dht_local_t *local = NULL;
+
+ local = lock_frame->local;
+ main_frame = local->main_frame;
+
+ local->lock.locks = NULL;
+ local->lock.lk_count = 0;
+
+ inodelk_cbk = local->lock.inodelk_cbk;
+ local->lock.inodelk_cbk = NULL;
+
+ inodelk_cbk (main_frame, NULL, main_frame->this, local->lock.op_ret,
+ local->lock.op_errno, NULL);
+
+ dht_lock_stack_destroy (lock_frame);
+ return;
+}
+
+int
+dht_inodelk_cleanup_cbk (call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret, int32_t op_errno,
+ dict_t *xdata)
+{
+ dht_inodelk_done (frame);
+ return 0;
+}
+
+inline int32_t
+dht_lock_count (dht_lock_t **lk_array, int lk_count)
+{
+ int i = 0, locked = 0;
+
+ if ((lk_array == NULL) || (lk_count == 0))
+ goto out;
+
+ for (i = 0; i < lk_count; i++) {
+ if (lk_array[i]->locked)
+ locked++;
+ }
+out:
+ return locked;
+}
+
+void
+dht_inodelk_cleanup (call_frame_t *lock_frame)
+{
+ dht_lock_t **lk_array = NULL;
+ int lk_count = 0, lk_acquired = 0;
+ dht_local_t *local = NULL;
+
+ local = lock_frame->local;
+
+ lk_array = local->lock.locks;
+ lk_count = local->lock.lk_count;
+
+ lk_acquired = dht_lock_count (lk_array, lk_count);
+ if (lk_acquired != 0) {
+ dht_unlock_inodelk (lock_frame, lk_array, lk_count,
+ dht_inodelk_cleanup_cbk);
+ } else {
+ dht_inodelk_done (lock_frame);
+ }
+
+ return;
+}
+
+int32_t
+dht_unlock_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata)
+{
+ dht_local_t *local = NULL;
+ int lk_index = 0, call_cnt = 0;
+ char gfid[GF_UUID_BUF_SIZE] = {0};
+
+ lk_index = (long) cookie;
+
+ local = frame->local;
+ if (op_ret < 0) {
+ uuid_utoa_r (local->lock.locks[lk_index]->loc.gfid,
+ gfid);
+
+ gf_log (this->name, GF_LOG_WARNING,
+ "unlocking failed on %s:%s (%s)",
+ local->lock.locks[lk_index]->xl->name,
+ gfid, strerror (op_errno));
+ } else {
+ local->lock.locks[lk_index]->locked = 0;
+ }
+
+ call_cnt = dht_frame_return (frame);
+ if (is_last_call (call_cnt)) {
+ dht_inodelk_done (frame);
+ }
+
+ return 0;
+}
+
+call_frame_t *
+dht_lock_frame (call_frame_t *parent_frame)
+{
+ call_frame_t *lock_frame = NULL;
+
+ lock_frame = copy_frame (parent_frame);
+ if (lock_frame == NULL)
+ goto out;
+
+ set_lk_owner_from_ptr (&lock_frame->root->lk_owner, parent_frame->root);
+
+out:
+ return lock_frame;
+}
+
+int32_t
+dht_unlock_inodelk (call_frame_t *frame, dht_lock_t **lk_array, int lk_count,
+ fop_inodelk_cbk_t inodelk_cbk)
+{
+ dht_local_t *local = NULL;
+ struct gf_flock flock = {0,};
+ int ret = -1 , i = 0;
+ call_frame_t *lock_frame = NULL;
+ int call_cnt = 0;
+
+ GF_VALIDATE_OR_GOTO ("dht-locks", frame, done);
+ GF_VALIDATE_OR_GOTO (frame->this->name, lk_array, done);
+ GF_VALIDATE_OR_GOTO (frame->this->name, inodelk_cbk, done);
+
+ call_cnt = dht_lock_count (lk_array, lk_count);
+ if (call_cnt == 0) {
+ ret = 0;
+ goto done;
+ }
+
+ lock_frame = dht_lock_frame (frame);
+ if (lock_frame == NULL) {
+ gf_log (frame->this->name, GF_LOG_WARNING,
+ "cannot allocate a frame, not unlocking following "
+ "locks:");
+
+ dht_log_lk_array (frame->this->name, GF_LOG_WARNING, lk_array,
+ lk_count);
+ goto done;
+ }
+
+ ret = dht_local_lock_init (lock_frame, lk_array, lk_count, inodelk_cbk);
+ if (ret < 0) {
+ gf_log (frame->this->name, GF_LOG_WARNING,
+ "storing locks in local failed, not unlocking "
+ "following locks:");
+
+ dht_log_lk_array (frame->this->name, GF_LOG_WARNING, lk_array,
+ lk_count);
+
+ goto done;
+ }
+
+ local = lock_frame->local;
+ local->main_frame = frame;
+ local->call_cnt = call_cnt;
+
+ flock.l_type = F_UNLCK;
+
+ for (i = 0; i < local->lock.lk_count; i++) {
+ if (!local->lock.locks[i]->locked)
+ continue;
+
+ STACK_WIND_COOKIE (lock_frame, dht_unlock_inodelk_cbk,
+ (void *)(long)i,
+ local->lock.locks[i]->xl,
+ local->lock.locks[i]->xl->fops->inodelk,
+ local->lock.locks[i]->domain,
+ &local->lock.locks[i]->loc, F_SETLK,
+ &flock, NULL);
+ }
+
+ return 0;
+
+done:
+ if (lock_frame)
+ dht_lock_stack_destroy (lock_frame);
+
+ /* no locks acquired, invoke inodelk_cbk */
+ if (ret == 0)
+ inodelk_cbk (frame, NULL, frame->this, 0, 0, NULL);
+
+ return ret;
+}
+
+int32_t
+dht_nonblocking_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata)
+{
+ dht_local_t *local = NULL;
+ int lk_index = 0, call_cnt = 0;
+ char gfid[GF_UUID_BUF_SIZE] = {0};
+
+ local = frame->local;
+ lk_index = (long) cookie;
+
+ if (op_ret == -1) {
+ local->lock.op_ret = -1;
+ local->lock.op_errno = op_errno;
+
+ if (local && local->lock.locks[lk_index]) {
+ uuid_utoa_r (local->lock.locks[lk_index]->loc.inode->gfid,
+ gfid);
+
+ gf_log (this->name, GF_LOG_DEBUG,
+ "inodelk failed on gfid: %s "
+ "subvolume: %s (%s)", gfid,
+ local->lock.locks[lk_index]->xl->name,
+ strerror (op_errno));
+ }
+
+ goto out;
+ }
+
+ local->lock.locks[lk_index]->locked = _gf_true;
+
+out:
+ call_cnt = dht_frame_return (frame);
+ if (is_last_call (call_cnt)) {
+ if (local->lock.op_ret < 0) {
+ dht_inodelk_cleanup (frame);
+ return 0;
+ }
+
+ dht_inodelk_done (frame);
+ }
+
+ return 0;
+}
+
+int
+dht_nonblocking_inodelk (call_frame_t *frame, dht_lock_t **lk_array,
+ int lk_count, fop_inodelk_cbk_t inodelk_cbk)
+{
+ struct gf_flock flock = {0,};
+ int i = 0, ret = 0;
+ dht_local_t *local = NULL;
+ call_frame_t *lock_frame = NULL;
+
+ GF_VALIDATE_OR_GOTO ("dht-locks", frame, out);
+ GF_VALIDATE_OR_GOTO (frame->this->name, lk_array, out);
+ GF_VALIDATE_OR_GOTO (frame->this->name, inodelk_cbk, out);
+
+ lock_frame = dht_lock_frame (frame);
+ if (lock_frame == NULL)
+ goto out;
+
+ ret = dht_local_lock_init (lock_frame, lk_array, lk_count, inodelk_cbk);
+ if (ret < 0) {
+ goto out;
+ }
+
+ local = lock_frame->local;
+ local->main_frame = frame;
+
+ local->call_cnt = lk_count;
+
+ for (i = 0; i < local->lock.lk_count; i++) {
+ flock.l_type = local->lock.locks[i]->type;
+
+ STACK_WIND_COOKIE (lock_frame, dht_nonblocking_inodelk_cbk,
+ (void *) (long) i,
+ local->lock.locks[i]->xl,
+ local->lock.locks[i]->xl->fops->inodelk,
+ local->lock.locks[i]->domain,
+ &local->lock.locks[i]->loc, F_SETLK,
+ &flock, NULL);
+ }
+
+ return 0;
+
+out:
+ if (lock_frame)
+ dht_lock_stack_destroy (lock_frame);
+
+ return -1;
+}
+
+int32_t
+dht_blocking_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata)
+{
+ int lk_index = 0;
+ dht_local_t *local = NULL;
+
+ lk_index = (long) cookie;
+
+ local = frame->local;
+
+ if (op_ret == 0) {
+ local->lock.locks[lk_index]->locked = _gf_true;
+ } else {
+ local->lock.op_ret = -1;
+ local->lock.op_errno = op_errno;
+ goto cleanup;
+ }
+
+ if (lk_index == (local->lock.lk_count - 1)) {
+ dht_inodelk_done (frame);
+ } else {
+ dht_blocking_inodelk_rec (frame, ++lk_index);
+ }
+
+ return 0;
+
+cleanup:
+ dht_inodelk_cleanup (frame);
+
+ return 0;
+}
+
+void
+dht_blocking_inodelk_rec (call_frame_t *frame, int i)
+{
+ dht_local_t *local = NULL;
+ struct gf_flock flock = {0,};
+
+ local = frame->local;
+
+ flock.l_type = local->lock.locks[i]->type;
+
+ STACK_WIND_COOKIE (frame, dht_blocking_inodelk_cbk,
+ (void *) (long) i,
+ local->lock.locks[i]->xl,
+ local->lock.locks[i]->xl->fops->inodelk,
+ local->lock.locks[i]->domain,
+ &local->lock.locks[i]->loc, F_SETLKW, &flock, NULL);
+
+ return;
+}
+
+int
+dht_lock_request_cmp (const void *val1, const void *val2)
+{
+ dht_lock_t *lock1 = NULL;
+ dht_lock_t *lock2 = NULL;
+ int ret = 0;
+
+ lock1 = (dht_lock_t *)val1;
+ lock2 = (dht_lock_t *)val2;
+
+ GF_VALIDATE_OR_GOTO ("dht-locks", lock1, out);
+ GF_VALIDATE_OR_GOTO ("dht-locks", lock2, out);
+
+ ret = strcmp (lock1->xl->name, lock2->xl->name);
+
+ if (ret == 0) {
+ ret = uuid_compare (lock1->loc.gfid, lock2->loc.gfid);
+ }
+
+out:
+ return ret;
+}
+
+int
+dht_lock_order_requests (dht_lock_t **locks, int count)
+{
+ int ret = -1;
+
+ if (!locks || !count)
+ goto out;
+
+ qsort (locks, count, sizeof (*locks), dht_lock_request_cmp);
+ ret = 0;
+
+out:
+ return ret;
+}
+
+int
+dht_blocking_inodelk (call_frame_t *frame, dht_lock_t **lk_array,
+ int lk_count, fop_inodelk_cbk_t inodelk_cbk)
+{
+ int ret = -1;
+ call_frame_t *lock_frame = NULL;
+ dht_local_t *local = NULL;
+
+ GF_VALIDATE_OR_GOTO ("dht-locks", frame, out);
+ GF_VALIDATE_OR_GOTO (frame->this->name, lk_array, out);
+ GF_VALIDATE_OR_GOTO (frame->this->name, inodelk_cbk, out);
+
+ lock_frame = dht_lock_frame (frame);
+ if (lock_frame == NULL)
+ goto out;
+
+ ret = dht_local_lock_init (lock_frame, lk_array, lk_count, inodelk_cbk);
+ if (ret < 0) {
+ goto out;
+ }
+
+ local = lock_frame->local;
+ local->main_frame = frame;
+
+ dht_blocking_inodelk_rec (lock_frame, 0);
+
+ return 0;
+out:
+ if (lock_frame)
+ dht_lock_stack_destroy (lock_frame);
+
+ return -1;
+}
|
[-]
[+]
|
Added |
glusterfs-3.4.6.tar.gz/xlators/cluster/dht/src/dht-helper.h
^
|
@@ -0,0 +1,19 @@
+/*
+ Copyright (c) 2008-2014 Red Hat, Inc. <http://www.redhat.com>
+ This file is part of GlusterFS.
+
+ This file is licensed to you under your choice of the GNU Lesser
+ General Public License, version 3 or any later version (LGPLv3 or
+ later), or the GNU General Public License, version 2 (GPLv2), in all
+ cases as published by the Free Software Foundation.
+*/
+#ifndef _DHT_HELPER_H
+#define _DHT_HELPER_H
+
+int
+dht_lock_order_requests (dht_lock_t **lk_array, int count);
+
+void
+dht_blocking_inodelk_rec (call_frame_t *frame, int i);
+
+#endif
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/cluster/dht/src/dht-inode-read.c
^
|
@@ -501,23 +501,34 @@
int ret = -1;
dht_local_t *local = NULL;
xlator_t *subvol = NULL;
+ call_frame_t *prev = NULL;
local = frame->local;
+ prev = cookie;
+ if (!prev || !prev->this)
+ goto out;
if (local->call_cnt != 1)
goto out;
- if ((op_ret == -1) && (op_errno == ENOTCONN) &&
+ if ((op_ret == -1) && ((op_errno == ENOTCONN) ||
+ (op_errno == ENOENT)) &&
IA_ISDIR(local->loc.inode->ia_type)) {
-
- subvol = dht_first_up_subvol (this);
+ subvol = dht_subvol_next_available (this, prev->this);
if (!subvol)
goto out;
+ /* check if we are done with visiting every node */
+ if (subvol == local->cached_subvol) {
+ goto out;
+ }
+
STACK_WIND (frame, dht_access_cbk, subvol, subvol->fops->access,
&local->loc, local->rebalance.flags, NULL);
return 0;
}
- if ((op_ret == -1) && (op_errno == ENOENT)) {
+
+ if ((op_ret == -1) && (op_errno == ENOENT) &&
+ !(IA_ISDIR(local->loc.inode->ia_type))) {
/* File would be migrated to other node */
local->op_errno = op_errno;
local->rebalance.target_op_fn = dht_access2;
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/cluster/dht/src/dht-rebalance.c
^
|
@@ -237,13 +237,15 @@
}
static inline int
-__dht_rebalance_create_dst_file (xlator_t *to, xlator_t *from, loc_t *loc, struct iatt *stbuf,
- dict_t *dict, fd_t **dst_fd)
+__dht_rebalance_create_dst_file (xlator_t *to, xlator_t *from, loc_t *loc,
+ struct iatt *stbuf, dict_t *dict,
+ fd_t **dst_fd)
{
- xlator_t *this = NULL;
- int ret = -1;
- fd_t *fd = NULL;
- struct iatt new_stbuf = {0,};
+ xlator_t *this = NULL;
+ int ret = -1;
+ fd_t *fd = NULL;
+ struct iatt new_stbuf = {0,};
+ struct iatt check_stbuf = {0,};
this = THIS;
@@ -300,6 +302,46 @@
goto out;
}
+ /*Reason of doing lookup after create again:
+ *In the create, there is some time-gap between opening fd at the
+ *server (posix_layer) and binding it in server (incrementing fd count),
+ *so if in that time-gap, if other process sends unlink considering it
+ *as a linkto file, because inode->fd count will be 0, so file will be
+ *unlinked at the backend. And because furthur operations are performed
+ *on fd, so though migration will be done but will end with no file
+ *at the backend.
+ */
+
+
+ ret = syncop_lookup (to, loc, NULL, &check_stbuf, NULL, NULL);
+ if (!ret) {
+ if (uuid_compare (stbuf->ia_gfid, check_stbuf.ia_gfid) != 0) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "file %s exists in %s with different gfid,"
+ "found in lookup after create",
+ loc->path, to->name);
+ ret = -1;
+ fd_unref (fd);
+ goto out;
+ }
+
+ }
+
+ if (-ret == ENOENT) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "%s: file does not exists"
+ "on %s (%s)", loc->path, to->name, strerror (-ret));
+ ret = -1;
+ fd_unref (fd);
+ goto out;
+ }
+
+ ret = syncop_fsetxattr (to, fd, dict, 0);
+ if (ret < 0)
+ gf_log (this->name, GF_LOG_WARNING,
+ "%s: failed to set xattr on %s (%s)",
+ loc->path, to->name, strerror (-ret));
+
ret = syncop_ftruncate (to, fd, stbuf->ia_size);
if (ret < 0)
gf_log (this->name, GF_LOG_ERROR,
@@ -650,17 +692,21 @@
dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
int flag)
{
- int ret = -1;
- struct iatt new_stbuf = {0,};
- struct iatt stbuf = {0,};
- struct iatt empty_iatt = {0,};
- ia_prot_t src_ia_prot = {0,};
- fd_t *src_fd = NULL;
- fd_t *dst_fd = NULL;
- dict_t *dict = NULL;
- dict_t *xattr = NULL;
- dict_t *xattr_rsp = NULL;
- int file_has_holes = 0;
+ int ret = -1;
+ struct iatt new_stbuf = {0,};
+ struct iatt stbuf = {0,};
+ struct iatt empty_iatt = {0,};
+ ia_prot_t src_ia_prot = {0,};
+ fd_t *src_fd = NULL;
+ fd_t *dst_fd = NULL;
+ dict_t *dict = NULL;
+ dict_t *xattr = NULL;
+ dict_t *xattr_rsp = NULL;
+ int file_has_holes = 0;
+ int rcvd_enoent_from_src = 0;
+ struct gf_flock flock = {0, };
+ loc_t tmp_loc = {0, };
+ gf_boolean_t locked = _gf_false;
gf_log (this->name, GF_LOG_INFO, "%s: attempting to move from %s to %s",
loc->path, from->name, to->name);
@@ -676,6 +722,24 @@
goto out;
}
+ flock.l_type = F_WRLCK;
+
+ tmp_loc.inode = inode_ref (loc->inode);
+ uuid_copy (tmp_loc.gfid, loc->gfid);
+
+ ret = syncop_inodelk (from, DHT_FILE_MIGRATE_DOMAIN, &tmp_loc, F_SETLKW,
+ &flock, NULL, NULL);
+ if (ret < 0) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "migrate file failed: "
+ "%s: failed to lock file on %s (%s)",
+ loc->path, from->name, strerror (-ret));
+ ret = -1;
+ goto out;
+ }
+
+ locked = _gf_true;
+
/* Phase 1 - Data migration is in progress from now on */
ret = syncop_lookup (from, loc, dict, &stbuf, &xattr_rsp, NULL);
if (ret) {
@@ -827,15 +891,31 @@
}
/* Do a stat and check the gfid before unlink */
+
+ /*
+ * Cached file changes its state from non-linkto to linkto file after
+ * migrating data. If lookup from any other mount-point is performed,
+ * converted-linkto-cached file will be treated as a stale and will be
+ * unlinked. But by this time, file is already migrated. So further
+ * failure because of ENOENT should not be treated as error
+ */
+
ret = syncop_stat (from, loc, &empty_iatt);
if (ret) {
gf_log (this->name, GF_LOG_WARNING,
"%s: failed to do a stat on %s (%s)",
loc->path, from->name, strerror (errno));
- goto out;
+
+ if (-ret != ENOENT) {
+ ret = -1;
+ goto out;
+ }
+
+ rcvd_enoent_from_src = 1;
}
- if (uuid_compare (empty_iatt.ia_gfid, loc->gfid) == 0) {
+ if ((uuid_compare (empty_iatt.ia_gfid, loc->gfid) == 0 ) &&
+ (!rcvd_enoent_from_src)) {
/* take out the source from namespace */
ret = syncop_unlink (from, loc);
if (ret) {
@@ -876,6 +956,18 @@
ret = 0;
out:
+ if (locked) {
+ flock.l_type = F_UNLCK;
+
+ ret = syncop_inodelk (from, DHT_FILE_MIGRATE_DOMAIN, &tmp_loc,
+ F_SETLK, &flock, NULL, NULL);
+ if (ret < 0) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "%s: failed to unlock file on %s (%s)",
+ loc->path, from->name, strerror (-ret));
+ }
+ }
+
if (dict)
dict_unref (dict);
@@ -889,6 +981,8 @@
if (src_fd)
syncop_close (src_fd);
+ loc_wipe (&tmp_loc);
+
return ret;
}
@@ -1121,6 +1215,12 @@
free_entries = _gf_true;
list_for_each_entry_safe (entry, tmp, &entries.list, list) {
+
+ if (dict) {
+ dict_unref (dict);
+ dict = NULL;
+ }
+
if (defrag->defrag_status != GF_DEFRAG_STATUS_STARTED) {
ret = 1;
goto out;
@@ -1210,16 +1310,13 @@
uuid_str = NULL;
- dict_del (dict, GF_XATTR_NODE_UUID_KEY);
-
-
/* if distribute is present, it will honor this key.
* -1 is returned if distribute is not present or file
* doesn't have a link-file. If file has link-file, the
* path of link-file will be the value, and also that
* guarantees that file has to be mostly migrated */
- ret = syncop_getxattr (this, &entry_loc, &dict,
+ ret = syncop_getxattr (this, &entry_loc, NULL,
GF_XATTR_LINKINFO_KEY);
if (ret < 0) {
gf_log (this->name, GF_LOG_TRACE, "failed to "
@@ -1326,6 +1423,7 @@
off_t offset = 0;
struct iatt iatt = {0,};
int readdirp_errno = 0;
+ inode_t *linked_inode = NULL, *inode = NULL;
ret = syncop_lookup (this, loc, NULL, &iatt, NULL, NULL);
if (ret) {
@@ -1393,6 +1491,7 @@
continue;
loc_wipe (&entry_loc);
+
ret =dht_build_child_loc (this, &entry_loc, loc,
entry->d_name);
if (ret) {
@@ -1408,9 +1507,23 @@
continue;
}
- entry_loc.inode->ia_type = entry->d_stat.ia_type;
uuid_copy (entry_loc.gfid, entry->d_stat.ia_gfid);
+
+ /*In case the gfid stored in the inode by inode_link
+ * and the gfid obtained in the lookup differs, then
+ * client3_3_lookup_cbk will return ESTALE and proper
+ * error will be captured
+ */
+
+ linked_inode = inode_link (entry_loc.inode, loc->inode,
+ entry->d_name,
+ &entry->d_stat);
+
+ inode = entry_loc.inode;
+ entry_loc.inode = linked_inode;
+ inode_unref (inode);
+
if (uuid_is_null (loc->gfid)) {
gf_log (this->name, GF_LOG_ERROR, "%s/%s"
"gfid not present", loc->path,
@@ -1571,7 +1684,7 @@
{
status = dict_new ();
gf_defrag_status_get (defrag, status);
- if (ctx->notify)
+ if (ctx && ctx->notify)
ctx->notify (GF_EN_DEFRAG_STATUS, status);
if (status)
dict_unref (status);
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/cluster/dht/src/dht-rename.c
^
|
@@ -21,6 +21,54 @@
#include "dht-common.h"
#include "defaults.h"
+int
+dht_rename_unlock_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata)
+{
+ dht_local_t *local = NULL;
+
+ local = frame->local;
+
+ DHT_STRIP_PHASE1_FLAGS (&local->stbuf);
+ DHT_STACK_UNWIND (rename, frame, local->op_ret, local->op_errno,
+ &local->stbuf, &local->preoldparent,
+ &local->postoldparent, &local->preparent,
+ &local->postparent, NULL);
+ return 0;
+}
+
+int
+dht_rename_unlock (call_frame_t *frame, xlator_t *this)
+{
+ dht_local_t *local = NULL;
+ int op_ret = -1;
+ char src_gfid[GF_UUID_BUF_SIZE] = {0};
+ char dst_gfid[GF_UUID_BUF_SIZE] = {0};
+
+ local = frame->local;
+
+ op_ret = dht_unlock_inodelk (frame, local->lock.locks,
+ local->lock.lk_count,
+ dht_rename_unlock_cbk);
+ if (op_ret < 0) {
+ uuid_utoa_r (local->loc.inode->gfid, src_gfid);
+
+ if (local->loc2.inode)
+ uuid_utoa_r (local->loc2.inode->gfid, dst_gfid);
+
+ gf_log (this->name, GF_LOG_WARNING,
+ "winding unlock inodelk failed "
+ "rename (%s:%s:%s %s:%s:%s), "
+ "stale locks left on bricks",
+ local->loc.path, src_gfid, local->src_cached->name,
+ local->loc2.path, dst_gfid,
+ local->dst_cached ? local->dst_cached->name : NULL);
+
+ dht_rename_unlock_cbk (frame, NULL, this, 0, 0, NULL);
+ }
+
+ return 0;
+}
int
dht_rename_dir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
@@ -67,16 +115,7 @@
unwind:
this_call_cnt = dht_frame_return (frame);
if (is_last_call (this_call_cnt)) {
- WIPE (&local->preoldparent);
- WIPE (&local->postoldparent);
- WIPE (&local->preparent);
- WIPE (&local->postparent);
-
- DHT_STRIP_PHASE1_FLAGS (&local->stbuf);
- DHT_STACK_UNWIND (rename, frame, local->op_ret, local->op_errno,
- &local->stbuf, &local->preoldparent,
- &local->postoldparent,
- &local->preparent, &local->postparent, xdata);
+ dht_rename_unlock (frame, this);
}
return 0;
@@ -155,9 +194,8 @@
DHT_STRIP_PHASE1_FLAGS (&local->stbuf);
DHT_STACK_UNWIND (rename, frame, local->op_ret, local->op_errno,
&local->stbuf, &local->preoldparent,
- &local->postoldparent,
- &local->preparent, &local->postparent, NULL);
-
+ &local->postoldparent, &local->preparent,
+ &local->postparent, NULL);
return 0;
}
@@ -307,6 +345,21 @@
return 0;
}
+int
+dht_rename_done (call_frame_t *frame, xlator_t *this)
+{
+ dht_local_t *local = NULL;
+
+ local = frame->local;
+
+ if (local->linked == _gf_true) {
+ local->linked = _gf_false;
+ dht_linkfile_attr_heal (frame, this);
+ }
+
+ dht_rename_unlock (frame, this);
+ return 0;
+}
int
dht_rename_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
@@ -340,11 +393,7 @@
WIPE (&local->postparent);
if (is_last_call (this_call_cnt)) {
- DHT_STRIP_PHASE1_FLAGS (&local->stbuf);
- DHT_STACK_UNWIND (rename, frame, local->op_ret, local->op_errno,
- &local->stbuf, &local->preoldparent,
- &local->postoldparent, &local->preparent,
- &local->postparent, NULL);
+ dht_rename_done (frame, this);
}
out:
@@ -375,30 +424,37 @@
if (src_cached == dst_cached)
goto nolinks;
- if (dst_hashed != src_hashed && dst_hashed != src_cached)
+ if (local->linked && (dst_hashed != src_hashed )&&
+ (dst_hashed != src_cached)) {
call_cnt++;
+ }
- if (src_cached != dst_hashed)
+ if (local->added_link && (src_cached != dst_hashed)) {
call_cnt++;
+ }
local->call_cnt = call_cnt;
if (!call_cnt)
goto nolinks;
- if (dst_hashed != src_hashed && dst_hashed != src_cached) {
+ if (local->linked && (dst_hashed != src_hashed) &&
+ (dst_hashed != src_cached)) {
+
gf_log (this->name, GF_LOG_TRACE,
"unlinking linkfile %s @ %s => %s",
local->loc.path, dst_hashed->name, src_cached->name);
+
STACK_WIND (frame, dht_rename_unlink_cbk,
dst_hashed, dst_hashed->fops->unlink,
&local->loc, 0, NULL);
}
- if (src_cached != dst_hashed) {
+ if (local->added_link && (src_cached != dst_hashed)) {
gf_log (this->name, GF_LOG_TRACE,
"unlinking link %s => %s (%s)", local->loc.path,
local->loc2.path, src_cached->name);
+
STACK_WIND (frame, dht_rename_unlink_cbk,
src_cached, src_cached->fops->unlink,
&local->loc2, 0, NULL);
@@ -412,12 +468,7 @@
WIPE (&local->preparent);
WIPE (&local->postparent);
- DHT_STRIP_PHASE1_FLAGS (&local->stbuf);
- DHT_STACK_UNWIND (rename, frame, local->op_ret, local->op_errno,
- &local->stbuf, &local->preoldparent,
- &local->postoldparent, &local->preparent,
- &local->postparent, NULL);
-
+ dht_rename_unlock (frame, this);
return 0;
}
@@ -476,13 +527,43 @@
dst_hashed = local->dst_hashed;
dst_cached = local->dst_cached;
+ /* It is a critical failure iff we fail to rename the cached file
+ * if the rename of the linkto failed, it is not a critical failure,
+ * and we do not want to lose the created hard link for the new
+ * name as that could have been read by other clients.
+ *
+ * NOTE: If another client is attempting the same oldname -> newname
+ * rename, and finds both file names as existing, and are hard links
+ * to each other, then FUSE would send in an unlink for oldname. In
+ * this time duration if we treat the linkto as a critical error and
+ * unlink the newname we created, we would have effectively lost the
+ * file to rename operations.
+ *
+ * Repercussions of treating this as a non-critical error is that
+ * we could leave behind a stale linkto file and/or not create the new
+ * linkto file, the second case would be rectified by a subsequent
+ * lookup, the first case by a rebalance, like for all stale linkto
+ * files */
if (op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING,
- "%s: rename on %s failed (%s)", local->loc.path,
- prev->this->name, strerror (op_errno));
- local->op_ret = op_ret;
- local->op_errno = op_errno;
- goto cleanup;
+ /* Critical failure: unable to rename the cached file */
+ if (src_cached == dst_cached) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "%s: rename on %s failed (%s)", local->loc.path,
+ prev->this->name, strerror (op_errno));
+ local->op_ret = op_ret;
+ local->op_errno = op_errno;
+ goto cleanup;
+ } else {
+ /* Non-critical failure, unable to rename the linkto
+ * file
+ */
+ gf_log (this->name, GF_LOG_INFO,
+ "%s: Rename (linkto file) on %s failed, "
+ "(gfid = %s) ",
+ local->loc.path, prev->this->name,
+ local->loc.inode ?
+ uuid_utoa(local->loc.inode->gfid):"");
+ }
}
if ((src_cached == dst_cached) && (dst_hashed != dst_cached)) {
@@ -582,12 +663,7 @@
WIPE (&local->preparent);
WIPE (&local->postparent);
- DHT_STRIP_PHASE1_FLAGS (&local->stbuf);
- DHT_STACK_UNWIND (rename, frame, local->op_ret, local->op_errno,
- &local->stbuf, &local->preoldparent,
- &local->postoldparent, &local->preparent,
- &local->postparent, NULL);
-
+ dht_rename_done (frame, this);
return 0;
cleanup:
@@ -631,9 +707,8 @@
return 0;
}
-
int
-dht_rename_links_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+dht_rename_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
inode_t *inode, struct iatt *stbuf,
struct iatt *preparent, struct iatt *postparent,
@@ -641,8 +716,6 @@
{
dht_local_t *local = NULL;
call_frame_t *prev = NULL;
- int this_call_cnt = 0;
-
local = frame->local;
prev = cookie;
@@ -652,20 +725,65 @@
"link/file on %s failed (%s)",
prev->this->name, strerror (op_errno));
local->op_ret = -1;
- if (op_errno != ENOENT)
- local->op_errno = op_errno;
+ local->op_errno = op_errno;
+ local->added_link = _gf_false;
} else {
dht_iatt_merge (this, &local->stbuf, stbuf, prev->this);
}
- this_call_cnt = dht_frame_return (frame);
- if (is_last_call (this_call_cnt)) {
- if (local->op_ret == -1)
- goto cleanup;
+ if (local->op_ret == -1)
+ goto cleanup;
- dht_do_rename (frame);
+ dht_do_rename (frame);
+
+ return 0;
+
+cleanup:
+ dht_rename_cleanup (frame);
+
+ return 0;
+}
+
+int
+dht_rename_linkto_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno,
+ inode_t *inode, struct iatt *stbuf,
+ struct iatt *preparent, struct iatt *postparent,
+ dict_t *xdata)
+{
+ dht_local_t *local = NULL;
+ call_frame_t *prev = NULL;
+ xlator_t *src_cached = NULL;
+
+ local = frame->local;
+ prev = cookie;
+
+ src_cached = local->src_cached;
+
+ if (op_ret == -1) {
+ gf_log (this->name, GF_LOG_DEBUG,
+ "link/file on %s failed (%s)",
+ prev->this->name, strerror (op_errno));
+ local->op_ret = -1;
+ local->op_errno = op_errno;
}
+ /* If linkto creation failed move to failure cleanup code,
+ * instead of continuing with creating the link file */
+ if (local->op_ret != 0) {
+ goto cleanup;
+ }
+
+ gf_log (this->name, GF_LOG_TRACE,
+ "link %s => %s (%s)", local->loc.path,
+ local->loc2.path, src_cached->name);
+
+ local->added_link = _gf_true;
+
+ STACK_WIND (frame, dht_rename_link_cbk,
+ src_cached, src_cached->fops->link,
+ &local->loc, &local->loc2, NULL);
+
return 0;
cleanup:
@@ -714,14 +832,13 @@
int
dht_rename_create_links (call_frame_t *frame)
{
- dht_local_t *local = NULL;
- xlator_t *this = NULL;
+ dht_local_t *local = NULL;
+ xlator_t *this = NULL;
xlator_t *src_hashed = NULL;
xlator_t *src_cached = NULL;
xlator_t *dst_hashed = NULL;
xlator_t *dst_cached = NULL;
- int call_cnt = 0;
-
+ int call_cnt = 0;
local = frame->local;
this = frame->this;
@@ -731,43 +848,59 @@
dst_hashed = local->dst_hashed;
dst_cached = local->dst_cached;
-
if (src_cached == dst_cached) {
if (dst_hashed == dst_cached)
goto nolinks;
+
gf_log (this->name, GF_LOG_TRACE,
- "unlinking dst linkfile %s @ %s",
- local->loc2.path, dst_hashed->name);
+ "unlinking dst linkfile %s @ %s",
+ local->loc2.path, dst_hashed->name);
STACK_WIND (frame, dht_rename_unlink_links_cbk,
dst_hashed, dst_hashed->fops->unlink,
&local->loc2, 0, NULL);
+
return 0;
}
- if (dst_hashed != src_hashed && dst_hashed != src_cached)
- call_cnt++;
-
- if (src_cached != dst_hashed)
+ if (src_cached != dst_hashed) {
+ /* needed to create the link file */
call_cnt++;
-
- local->call_cnt = call_cnt;
-
- if (dst_hashed != src_hashed && dst_hashed != src_cached) {
+ if (dst_hashed != src_hashed)
+ /* needed to create the linkto file */
+ call_cnt ++;
+ }
+
+ /* We should not have any failures post the link creation, as this
+ * introduces the newname into the namespace. Clients could have cached
+ * the existence of the newname and may start taking actions based on
+ * the same. Hence create the linkto first, and then attempt the link.
+ *
+ * NOTE: If another client is attempting the same oldname -> newname
+ * rename, and finds both file names as existing, and are hard links
+ * to each other, then FUSE would send in an unlink for oldname. In
+ * this time duration if we treat the linkto as a critical error and
+ * unlink the newname we created, we would have effectively lost the
+ * file to rename operations. */
+ if (dst_hashed != src_hashed && src_cached != dst_hashed) {
gf_log (this->name, GF_LOG_TRACE,
"linkfile %s @ %s => %s",
- local->loc.path, dst_hashed->name, src_cached->name);
+ local->loc.path, dst_hashed->name,
+ src_cached->name);
+
memcpy (local->gfid, local->loc.inode->gfid, 16);
- dht_linkfile_create (frame, dht_rename_links_cbk,
- src_cached, dst_hashed, &local->loc);
- }
- if (src_cached != dst_hashed) {
+ dht_linkfile_create (frame, dht_rename_linkto_cbk,
+ src_cached, dst_hashed, &local->loc);
+ } else if (src_cached != dst_hashed) {
gf_log (this->name, GF_LOG_TRACE,
- "link %s => %s (%s)", local->loc.path,
- local->loc2.path, src_cached->name);
- STACK_WIND (frame, dht_rename_links_cbk,
+ "link %s => %s (%s)", local->loc.path,
+ local->loc2.path, src_cached->name);
+
+ local->added_link = _gf_true;
+
+ STACK_WIND (frame, dht_rename_link_cbk,
src_cached, src_cached->fops->link,
&local->loc, &local->loc2, NULL);
}
@@ -783,6 +916,176 @@
int
+dht_rename_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int op_ret, int op_errno,
+ inode_t *inode, struct iatt *stbuf, dict_t *xattr,
+ struct iatt *postparent)
+{
+ dht_local_t *local = NULL;
+ int call_cnt = 0;
+
+ local = frame->local;
+
+ if (op_ret < 0) {
+ /* The meaning of is_linkfile is overloaded here. For locking
+ * to work properly both rebalance and rename should acquire
+ * lock on datafile. The reason for sending this lookup is to
+ * find out whether we've acquired a lock on data file.
+ * Between the lookup before rename and this rename, the
+ * file could be migrated by a rebalance process and now this
+ * file this might be a linkto file. We verify that by sending
+ * this lookup. However, if this lookup fails we cannot really
+ * say whether we've acquired lock on a datafile or linkto file.
+ * So, we act conservatively and _assume_
+ * that this is a linkfile and fail the rename operation.
+ */
+ local->is_linkfile = _gf_true;
+ } else if (xattr && check_is_linkfile (inode, stbuf, xattr)) {
+ local->is_linkfile = _gf_true;
+ }
+
+ call_cnt = dht_frame_return (frame);
+ if (is_last_call (call_cnt)) {
+ if (local->is_linkfile) {
+ local->op_ret = -1;
+ local->op_errno = EBUSY;
+ goto fail;
+ }
+
+ dht_rename_create_links (frame);
+ }
+
+ return 0;
+fail:
+ dht_rename_unlock (frame, this);
+ return 0;
+}
+
+int32_t
+dht_rename_lock_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata)
+{
+ dht_local_t *local = NULL;
+ char src_gfid[GF_UUID_BUF_SIZE] = {0};
+ char dst_gfid[GF_UUID_BUF_SIZE] = {0};
+ dict_t *xattr_req = NULL;
+ int i = 0;
+
+ local = frame->local;
+
+ if (op_ret < 0) {
+ uuid_utoa_r (local->loc.inode->gfid, src_gfid);
+
+ if (local->loc2.inode)
+ uuid_utoa_r (local->loc2.inode->gfid, dst_gfid);
+
+ gf_log (this->name, GF_LOG_WARNING,
+ "acquiring inodelk failed (%s) "
+ "rename (%s:%s:%s %s:%s:%s), returning EBUSY",
+ strerror (op_errno),
+ local->loc.path, src_gfid, local->src_cached->name,
+ local->loc2.path, dst_gfid,
+ local->dst_cached ? local->dst_cached->name : NULL);
+
+ local->op_ret = -1;
+ local->op_errno = (op_errno == EAGAIN) ? EBUSY : op_errno;
+
+ goto done;
+ }
+
+ xattr_req = dict_new ();
+ if (xattr_req == NULL) {
+ local->op_ret = -1;
+ local->op_errno = ENOMEM;
+ goto done;
+ }
+
+ op_ret = dict_set_uint32 (xattr_req, DHT_LINKFILE_KEY, 256);
+ if (op_ret < 0) {
+ local->op_ret = -1;
+ local->op_errno = -op_ret;
+ goto done;
+ }
+
+ local->call_cnt = local->lock.lk_count;
+
+ for (i = 0; i < local->lock.lk_count; i++) {
+ STACK_WIND (frame, dht_rename_lookup_cbk,
+ local->lock.locks[i]->xl,
+ local->lock.locks[i]->xl->fops->lookup,
+ &local->lock.locks[i]->loc, xattr_req);
+ }
+
+ dict_unref (xattr_req);
+ return 0;
+
+done:
+ /* Its fine to call unlock even when no locks are acquired, as we check
+ * for lock->locked before winding a unlock call.
+ */
+ dht_rename_unlock (frame, this);
+
+ if (xattr_req)
+ dict_unref (xattr_req);
+
+ return 0;
+}
+
+int
+dht_rename_lock (call_frame_t *frame)
+{
+ dht_local_t *local = NULL;
+ int count = 1, ret = -1;
+ dht_lock_t **lk_array = NULL;
+
+ local = frame->local;
+
+ if (local->dst_cached)
+ count++;
+
+ lk_array = GF_CALLOC (count, sizeof (*lk_array), gf_common_mt_char);
+ if (lk_array == NULL)
+ goto err;
+
+ lk_array[0] = dht_lock_new (frame->this, local->src_cached, &local->loc,
+ F_WRLCK, DHT_FILE_MIGRATE_DOMAIN);
+ if (lk_array[0] == NULL)
+ goto err;
+
+ if (local->dst_cached) {
+ lk_array[1] = dht_lock_new (frame->this, local->dst_cached,
+ &local->loc2, F_WRLCK,
+ DHT_FILE_MIGRATE_DOMAIN);
+ if (lk_array[1] == NULL)
+ goto err;
+ }
+
+ local->lock.locks = lk_array;
+ local->lock.lk_count = count;
+
+ ret = dht_nonblocking_inodelk (frame, lk_array, count,
+ dht_rename_lock_cbk);
+ if (ret < 0) {
+ local->lock.locks = NULL;
+ local->lock.lk_count = 0;
+ goto err;
+ }
+
+ return 0;
+err:
+ if (lk_array != NULL) {
+ int tmp_count = 0, i = 0;
+
+ for (i = 0; (i < count) && (lk_array[i]); i++, tmp_count++);
+
+ dht_lock_array_free (lk_array, tmp_count);
+ GF_FREE (lk_array);
+ }
+
+ return -1;
+}
+
+int
dht_rename (call_frame_t *frame, xlator_t *this,
loc_t *oldloc, loc_t *newloc, dict_t *xdata)
{
@@ -849,7 +1152,7 @@
local->dst_hashed = dst_hashed;
local->dst_cached = dst_cached;
- gf_log (this->name, GF_LOG_TRACE,
+ gf_log (this->name, GF_LOG_INFO,
"renaming %s (hash=%s/cache=%s) => %s (hash=%s/cache=%s)",
oldloc->path, src_hashed->name, src_cached->name,
newloc->path, dst_hashed->name,
@@ -859,7 +1162,9 @@
dht_rename_dir (frame, this);
} else {
local->op_ret = 0;
- dht_rename_create_links (frame);
+ ret = dht_rename_lock (frame);
+ if (ret < 0)
+ goto err;
}
return 0;
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/cluster/dht/src/dht.c
^
|
@@ -213,6 +213,9 @@
GF_FREE (conf->file_layouts);
}
+ if (conf->lock_pool)
+ mem_pool_destroy (conf->lock_pool);
+
GF_FREE (conf->subvolumes);
GF_FREE (conf->subvolume_status);
@@ -483,6 +486,14 @@
goto err;
}
+ conf->lock_pool = mem_pool_new (dht_lock_t, 512);
+ if (!conf->lock_pool) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "failed to create lock mem_pool, failing "
+ "initialization");
+ goto err;
+ }
+
this->private = conf;
return 0;
@@ -504,6 +515,9 @@
GF_FREE (conf->defrag);
+ if (conf->lock_pool)
+ mem_pool_destroy (conf->lock_pool);
+
GF_FREE (conf);
}
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/cluster/stripe/src/stripe.c
^
|
@@ -4323,26 +4323,23 @@
LOCK (&frame->lock);
{
- if (op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING,
- "%s returned error %s",
- prev->this->name, strerror (op_errno));
- local->op_errno = op_errno;
- local->op_ret = op_ret;
- goto unlock;
- } else {
- local->op_ret = op_ret;
+ local->op_errno = op_errno;
+ local->op_ret = op_ret;
+
+ if (op_ret != -1) {
list_splice_init (&orig_entries->list,
&local->entries.list);
local->wind_count = op_ret;
}
}
-unlock:
UNLOCK (&frame->lock);
- if (op_ret == -1)
+ if (op_ret == -1) {
+ gf_log (this->name, GF_LOG_WARNING, "%s returned error %s",
+ prev->this->name, strerror (op_errno));
goto out;
+ }
xattrs = dict_new ();
if (xattrs)
@@ -4402,10 +4399,15 @@
out:
if (!count) {
/* all entries are directories */
- frame->local = NULL;
- STRIPE_STACK_UNWIND (readdir, frame, local->op_ret,
- local->op_errno, &local->entries, NULL);
- gf_dirent_free (&local->entries);
+ if (frame)
+ frame->local = NULL;
+ STRIPE_STACK_UNWIND (readdir, frame,
+ local ? local->op_ret : -1,
+ local ? local->op_errno : EINVAL,
+ local ? &local->entries : NULL,
+ NULL);
+ if (local)
+ gf_dirent_free (&local->entries);
stripe_local_wipe (local);
mem_put (local);
}
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/debug/trace/src/trace.c
^
|
@@ -3134,7 +3134,7 @@
gf_log (this->name, GF_LOG_DEBUG, "logging to history %s",
(conf->log_history == _gf_true)?"enabled":"disabled");
- history = eh_new (history_size, _gf_false);
+ history = eh_new (history_size, _gf_false, NULL);
if (!history) {
gf_log (this->name, GF_LOG_ERROR, "event history cannot be "
"initialized");
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/features/marker/utils/src/gsyncd.c
^
|
@@ -70,7 +70,7 @@
int ret = 0;
assert (str);
- str = strdup (str);
+ str = gf_strdup (str);
if (!str)
return -1;
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/mgmt/glusterd/src/glusterd-mountbroker.c
^
|
@@ -671,7 +671,7 @@
ret = -1;
gf_log ("", GF_LOG_WARNING, "unsuccessful mount request (%s)",
strerror (*op_errno));
- if (mtptemp) {
+ if (mtptemp && cookieswitch) {
*cookieswitch = '/';
unlink (mtptemp);
*cookieswitch = '\0';
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
^
|
@@ -891,7 +891,7 @@
"%s", strerror (errno));
goto out;
}
- close (fd);
+ sys_close (fd);
file = fopen (filename, "w+");
if (!file) {
@@ -906,6 +906,7 @@
ttype = glusterd_get_trans_type_rb (volinfo->transport_type);
if (NULL == ttype){
ret = -1;
+ fclose (file);
goto out;
}
@@ -970,7 +971,7 @@
"%s", strerror (errno));
goto out;
}
- close (fd);
+ sys_close (fd);
file = fopen (filename, "w+");
if (!file) {
@@ -983,6 +984,7 @@
trans_type = glusterd_get_trans_type_rb (volinfo->transport_type);
if (NULL == trans_type){
ret = -1;
+ fclose (file);
goto out;
}
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/mgmt/glusterd/src/glusterd-sm.c
^
|
@@ -245,7 +245,8 @@
out:
if (ret) {
GF_FREE (new_event);
- GF_FREE (new_ev_ctx->hostname);
+ if (new_ev_ctx)
+ GF_FREE (new_ev_ctx->hostname);
GF_FREE (new_ev_ctx);
}
gf_log ("", GF_LOG_DEBUG, "returning with %d", ret);
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/mgmt/glusterd/src/glusterd-store.c
^
|
@@ -1247,10 +1247,10 @@
ret = gf_store_rename_tmppath (handle);
out:
- if (ret && (handle->fd > 0))
+ if (ret && handle && (handle->fd > 0))
gf_store_unlink_tmppath (handle);
- if (handle->fd > 0) {
+ if (handle && handle->fd > 0) {
close (handle->fd);
handle->fd = 0;
}
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/mgmt/glusterd/src/glusterd-utils.c
^
|
@@ -4240,14 +4240,14 @@
xlator_t *this = NULL;
glusterd_conf_t *conf = NULL;
- if ((!brickinfo) || (!volinfo))
- goto out;
-
this = THIS;
GF_ASSERT (this);
conf = this->private;
GF_ASSERT (conf);
+ if ((!brickinfo) || (!volinfo))
+ goto out;
+
if (uuid_is_null (brickinfo->uuid)) {
ret = glusterd_resolve_brick (brickinfo);
if (ret) {
@@ -5074,14 +5074,14 @@
xlator_t *this = NULL;
glusterd_conf_t *conf = NULL;
- if ((!brickinfo) || (!volinfo))
- goto out;
-
this = THIS;
GF_ASSERT (this);
conf = this->private;
GF_ASSERT (conf);
+ if ((!brickinfo) || (!volinfo))
+ goto out;
+
if (uuid_is_null (brickinfo->uuid)) {
ret = glusterd_resolve_brick (brickinfo);
if (ret) {
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/mount/fuse/src/fuse-bridge.c
^
|
@@ -522,12 +522,32 @@
}
void
+fuse_fop_resume (fuse_state_t *state)
+{
+ fuse_resume_fn_t fn = NULL;
+
+ /*
+ * * Fail fd resolution failures right away.
+ * */
+ if (state->resolve.fd && state->resolve.op_ret < 0) {
+ send_fuse_err (state->this, state->finh,
+ state->resolve.op_errno);
+ free_fuse_state (state);
+ return;
+ }
+
+ fn = state->resume_fn;
+ fn (state);
+}
+
+void
fuse_lookup_resume (fuse_state_t *state)
{
if (!state->loc.parent && !state->loc.inode) {
gf_log ("fuse", GF_LOG_ERROR, "failed to resolve path %s",
state->loc.path);
- send_fuse_err (state->this, state->finh, ENOENT);
+ send_fuse_err (state->this, state->finh,
+ state->resolve.op_errno);
free_fuse_state (state);
return;
}
@@ -732,7 +752,8 @@
"%"PRIu64": GETATTR %"PRIu64" (%s) resolution failed",
state->finh->unique, state->finh->nodeid,
uuid_utoa (state->resolve.gfid));
- send_fuse_err (state->this, state->finh, ENOENT);
+ send_fuse_err (state->this, state->finh,
+ state->resolve.op_errno);
free_fuse_state (state);
return;
}
@@ -1044,7 +1065,8 @@
"%"PRIu64": SETATTR %"PRIu64" (%s) resolution failed",
state->finh->unique, state->finh->nodeid,
uuid_utoa (state->resolve.gfid));
- send_fuse_err (state->this, state->finh, ENOENT);
+ send_fuse_err (state->this, state->finh,
+ state->resolve.op_errno);
free_fuse_state (state);
return;
}
@@ -1249,7 +1271,8 @@
"%"PRIu64": ACCESS %"PRIu64" (%s) resolution failed",
state->finh->unique, state->finh->nodeid,
uuid_utoa (state->resolve.gfid));
- send_fuse_err (state->this, state->finh, ENOENT);
+ send_fuse_err (state->this, state->finh,
+ state->resolve.op_errno);
free_fuse_state (state);
return;
}
@@ -1326,7 +1349,8 @@
gf_log ("glusterfs-fuse", GF_LOG_ERROR,
"READLINK %"PRIu64" (%s) resolution failed",
state->finh->unique, uuid_utoa (state->resolve.gfid));
- send_fuse_err (state->this, state->finh, ENOENT);
+ send_fuse_err (state->this, state->finh,
+ state->resolve.op_errno);
free_fuse_state (state);
return;
}
@@ -1361,7 +1385,8 @@
"MKNOD %"PRId64"/%s (%s/%s) resolution failed",
state->finh->nodeid, state->resolve.bname,
uuid_utoa (state->resolve.gfid), state->resolve.bname);
- send_fuse_err (state->this, state->finh, ENOENT);
+ send_fuse_err (state->this, state->finh,
+ state->resolve.op_errno);
free_fuse_state (state);
return;
}
@@ -1431,7 +1456,8 @@
"MKDIR %"PRId64" (%s/%s) resolution failed",
state->finh->nodeid, uuid_utoa (state->resolve.gfid),
state->resolve.bname);
- send_fuse_err (state->this, state->finh, ENOENT);
+ send_fuse_err (state->this, state->finh,
+ state->resolve.op_errno);
free_fuse_state (state);
return;
}
@@ -1493,7 +1519,8 @@
"UNLINK %"PRId64" (%s/%s) resolution failed",
state->finh->nodeid, uuid_utoa (state->resolve.gfid),
state->resolve.bname);
- send_fuse_err (state->this, state->finh, ENOENT);
+ send_fuse_err (state->this, state->finh,
+ state->resolve.op_errno);
free_fuse_state (state);
return;
}
@@ -1529,7 +1556,8 @@
"RMDIR %"PRId64" (%s/%s) resolution failed",
state->finh->nodeid, uuid_utoa (state->resolve.gfid),
state->resolve.bname);
- send_fuse_err (state->this, state->finh, ENOENT);
+ send_fuse_err (state->this, state->finh,
+ state->resolve.op_errno);
free_fuse_state (state);
return;
}
@@ -1565,7 +1593,8 @@
"SYMLINK %"PRId64" (%s/%s) -> %s resolution failed",
state->finh->nodeid, uuid_utoa (state->resolve.gfid),
state->resolve.bname, state->name);
- send_fuse_err (state->this, state->finh, ENOENT);
+ send_fuse_err (state->this, state->finh,
+ state->resolve.op_errno);
free_fuse_state (state);
return;
}
@@ -1681,7 +1710,8 @@
uuid_utoa_r (state->resolve2.gfid, loc2_uuid),
state->resolve2.bname);
- send_fuse_err (state->this, state->finh, ENOENT);
+ send_fuse_err (state->this, state->finh,
+ state->resolve.op_errno);
free_fuse_state (state);
return;
}
@@ -1738,7 +1768,8 @@
gf_log ("glusterfs-fuse", GF_LOG_WARNING,
"fuse_loc_fill() failed %"PRIu64": LINK %s %s",
state->finh->unique, state->loc2.path, state->loc.path);
- send_fuse_err (state->this, state->finh, ENOENT);
+ send_fuse_err (state->this, state->finh,
+ state->resolve.op_errno);
free_fuse_state (state);
return;
}
@@ -1889,7 +1920,8 @@
"%"PRIu64" CREATE %s/%s resolution failed",
state->finh->unique, uuid_utoa (state->resolve.gfid),
state->resolve.bname);
- send_fuse_err (state->this, state->finh, ENOENT);
+ send_fuse_err (state->this, state->finh,
+ state->resolve.op_errno);
free_fuse_state (state);
return;
}
@@ -1995,7 +2027,8 @@
"%"PRIu64": OPEN %s resolution failed",
state->finh->unique, uuid_utoa (state->resolve.gfid));
- send_fuse_err (state->this, state->finh, ENOENT);
+ send_fuse_err (state->this, state->finh,
+ state->resolve.op_errno);
free_fuse_state (state);
return;
}
@@ -2375,7 +2408,8 @@
gf_log ("glusterfs-fuse", GF_LOG_WARNING,
"%"PRIu64": OPENDIR (%s) resolution failed",
state->finh->unique, uuid_utoa (state->resolve.gfid));
- send_fuse_err (state->this, state->finh, ENOENT);
+ send_fuse_err (state->this, state->finh,
+ state->resolve.op_errno);
free_fuse_state (state);
return;
}
@@ -2840,7 +2874,8 @@
"%"PRIu64": STATFS (%s) resolution fail",
state->finh->unique, uuid_utoa (state->resolve.gfid));
- send_fuse_err (state->this, state->finh, ENOENT);
+ send_fuse_err (state->this, state->finh,
+ state->resolve.op_errno);
free_fuse_state (state);
return;
}
@@ -2875,7 +2910,8 @@
"resolution failed",
state->finh->unique, uuid_utoa (state->resolve.gfid),
state->finh->nodeid, state->name);
- send_fuse_err (state->this, state->finh, ENOENT);
+ send_fuse_err (state->this, state->finh,
+ state->resolve.op_errno);
free_fuse_state (state);
return;
}
@@ -2919,6 +2955,8 @@
priv = this->private;
+ GET_STATE (this, finh, state);
+
#ifdef GF_DARWIN_HOST_OS
if (fsi->position) {
gf_log ("glusterfs-fuse", GF_LOG_WARNING,
@@ -2977,7 +3015,6 @@
return;
}
- GET_STATE (this, finh, state);
state->size = fsi->size;
fuse_resolve_inode_init (state, &state->resolve, finh->nodeid);
@@ -3170,7 +3207,8 @@
uuid_utoa (state->resolve.gfid),
state->finh->nodeid, state->name);
- send_fuse_err (state->this, state->finh, ENOENT);
+ send_fuse_err (state->this, state->finh,
+ state->resolve.op_errno);
free_fuse_state (state);
return;
}
@@ -3206,10 +3244,13 @@
fuse_state_t *state = NULL;
struct fuse_private *priv = NULL;
int rv = 0;
+ int op_errno = EINVAL;
char *newkey = NULL;
priv = this->private;
+ GET_STATE (this, finh, state);
+
#ifdef GF_DARWIN_HOST_OS
if (fgxi->position) {
/* position can be used only for
@@ -3224,45 +3265,43 @@
"%"PRIu64": GETXATTR %s/%"PRIu64" (%s):"
"refusing positioned getxattr",
finh->unique, state->loc.path, finh->nodeid, name);
- send_fuse_err (this, finh, EINVAL);
- FREE (finh);
- return;
+ op_errno = EINVAL;
+ goto err;
}
#endif
if (!priv->acl) {
if ((strcmp (name, "system.posix_acl_access") == 0) ||
(strcmp (name, "system.posix_acl_default") == 0)) {
- send_fuse_err (this, finh, ENOTSUP);
- GF_FREE (finh);
- return;
+ op_errno = ENOTSUP;
+ goto err;
}
}
if (!priv->selinux) {
if (strncmp (name, "security.", 9) == 0) {
- send_fuse_err (this, finh, ENODATA);
- GF_FREE (finh);
- return;
+ op_errno = ENODATA;
+ goto err;
}
}
- GET_STATE (this, finh, state);
-
fuse_resolve_inode_init (state, &state->resolve, finh->nodeid);
rv = fuse_flip_xattr_ns (priv, name, &newkey);
if (rv) {
- send_fuse_err (this, finh, ENOMEM);
- free_fuse_state (state);
- goto out;
+ op_errno = ENOMEM;
+ goto err;
}
state->size = fgxi->size;
state->name = newkey;
fuse_resolve_and_resume (state, fuse_getxattr_resume);
- out:
+
+ return;
+ err:
+ send_fuse_err (this, finh, op_errno);
+ free_fuse_state (state);
return;
}
@@ -3276,7 +3315,8 @@
"resolution failed", state->finh->unique,
uuid_utoa (state->resolve.gfid), state->finh->nodeid);
- send_fuse_err (state->this, state->finh, ENOENT);
+ send_fuse_err (state->this, state->finh,
+ state->resolve.op_errno);
free_fuse_state (state);
return;
}
@@ -3331,7 +3371,8 @@
state->finh->unique, uuid_utoa (state->resolve.gfid),
state->finh->nodeid, state->name);
- send_fuse_err (state->this, state->finh, ENOENT);
+ send_fuse_err (state->this, state->finh,
+ state->resolve.op_errno);
free_fuse_state (state);
return;
}
@@ -4425,7 +4466,7 @@
fuse_private_t *priv = NULL;
ssize_t res = 0;
struct iobuf *iobuf = NULL;
- fuse_in_header_t *finh;
+ fuse_in_header_t *finh = NULL;
struct iovec iov_in[2];
void *msg = NULL;
const size_t msg0_size = sizeof (*finh) + 128;
@@ -5191,7 +5232,7 @@
if (priv->fd == -1)
goto cleanup_exit;
- event = eh_new (FUSE_EVENT_HISTORY_SIZE, _gf_false);
+ event = eh_new (FUSE_EVENT_HISTORY_SIZE, _gf_false, NULL);
if (!event) {
gf_log (this_xl->name, GF_LOG_ERROR,
"could not create a new event history");
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/mount/fuse/src/fuse-bridge.h
^
|
@@ -145,10 +145,17 @@
#define FUSE_FOP(state, ret, op_num, fop, args ...) \
do { \
- call_frame_t *frame = NULL; \
- xlator_t *xl = NULL; \
- int32_t op_ret = 0, op_errno = 0; \
- fuse_resolve_t *resolve = NULL; \
+ xlator_t *xl = NULL; \
+ call_frame_t *frame = NULL; \
+ \
+ xl = state->active_subvol; \
+ if (!xl) { \
+ gf_log_callingfn (state->this->name, GF_LOG_ERROR, \
+ "No active subvolume"); \
+ send_fuse_err (state->this, state->finh, ENOENT); \
+ free_fuse_state (state); \
+ break; \
+ } \
\
frame = get_call_frame_for_req (state); \
if (!frame) { \
@@ -158,13 +165,7 @@
* better than trying to go on with a NULL \
* frame ... \
*/ \
- gf_log_callingfn ("glusterfs-fuse", \
- GF_LOG_ERROR, \
- "FUSE message" \
- " unique %"PRIu64" opcode %d:" \
- " frame allocation failed", \
- state->finh->unique, \
- state->finh->opcode); \
+ send_fuse_err (state->this, state->finh, ENOMEM); \
free_fuse_state (state); \
/* ideally, need to 'return', but let the */ \
/* calling function take care of it */ \
@@ -175,150 +176,15 @@
frame->root->op = op_num; \
frame->op = op_num; \
\
- if ( state->resolve_now ) { \
- resolve = state->resolve_now; \
- } else { \
- resolve = &(state->resolve); \
- } \
- \
- xl = state->active_subvol; \
- if (!xl) { \
- gf_log_callingfn ("glusterfs-fuse", GF_LOG_ERROR, \
- "xl is NULL"); \
- op_errno = ENOENT; \
- op_ret = -1; \
- } else if (resolve->op_ret < 0) { \
- op_errno = resolve->op_errno; \
- op_ret = -1; \
- if (op_num == GF_FOP_LOOKUP) { \
- gf_log ("glusterfs-fuse", \
- (op_errno == ENOENT ? GF_LOG_TRACE \
- : GF_LOG_WARNING), \
- "%"PRIu64": %s() %s => -1 (%s)", \
- frame->root->unique, \
- gf_fop_list[frame->root->op], \
- resolve->resolve_loc.path, \
- strerror (op_errno)); \
- } else { \
- gf_log ("glusterfs-fuse", \
- GF_LOG_WARNING, \
- "%"PRIu64": %s() inode " \
- "migration of %s failed (%s)", \
- frame->root->unique, \
- gf_fop_list[frame->root->op], \
- resolve->resolve_loc.path, \
- strerror (op_errno)); \
- } \
- } else if (state->resolve2.op_ret < 0) { \
- op_errno = state->resolve2.op_errno; \
- op_ret = -1; \
- gf_log ("glusterfs-fuse", \
- GF_LOG_WARNING, \
- "%"PRIu64": %s() inode " \
- "migration of %s failed (%s)", \
- frame->root->unique, \
- gf_fop_list[frame->root->op], \
- state->resolve2.resolve_loc.path, \
- strerror (op_errno)); \
- } \
- \
- if (op_ret < 0) { \
- send_fuse_err (state->this, state->finh, op_errno); \
- free_fuse_state (state); \
- STACK_DESTROY (frame->root); \
- } else { \
- if (state->this->history) \
- gf_log_eh ("%"PRIu64", %s, path: (%s), gfid: " \
- "(%s)", frame->root->unique, \
- gf_fop_list[frame->root->op], \
- state->loc.path, \
- (state->fd == NULL)? \
- uuid_utoa (state->loc.gfid): \
- uuid_utoa (state->fd->inode->gfid));\
- STACK_WIND (frame, ret, xl, xl->fops->fop, args); \
- } \
- \
- } while (0)
-
-
-#define FUSE_FOP_COOKIE(state, xl, ret, cky, op_num, fop, args ...) \
- do { \
- call_frame_t *frame = NULL; \
- xlator_t *xl = NULL; \
- int32_t op_ret = 0, op_errno = 0; \
- \
- frame = get_call_frame_for_req (state); \
- if (!frame) { \
- gf_log ("glusterfs-fuse", \
- GF_LOG_ERROR, \
- "FUSE message" \
- " unique %"PRIu64" opcode %d:" \
- " frame allocation failed", \
- state->finh->unique, \
- state->finh->opcode); \
- free_fuse_state (state); \
- return 0; \
- } \
- \
- frame->root->state = state; \
- frame->root->op = op_num; \
- frame->op = op_num; \
- \
- xl = state->active_subvol; \
- if (!xl) { \
- gf_log_callingfn ("glusterfs-fuse", GF_LOG_ERROR, \
- "xl is NULL"); \
- op_errno = ENOENT; \
- op_ret = -1; \
- } else if (state->resolve.op_ret < 0) { \
- op_errno = state->resolve.op_errno; \
- op_ret = -1; \
- if (op_num == GF_FOP_LOOKUP) { \
- gf_log ("glusterfs-fuse", \
- (op_errno == ENOENT ? GF_LOG_TRACE \
- : GF_LOG_WARNING), \
- "%"PRIu64": %s() %s => -1 (%s)", \
- frame->root->unique, \
- gf_fop_list[frame->root->op], \
- state->resolve.resolve_loc.path, \
- strerror (op_errno)); \
- } else { \
- gf_log ("glusterfs-fuse", \
- GF_LOG_WARNING, \
- "%"PRIu64": %s() inode " \
- "migration of %s failed (%s)", \
- frame->root->unique, \
- gf_fop_list[frame->root->op], \
- state->resolve.resolve_loc.path, \
- strerror (op_errno)); \
- } \
- } else if (state->resolve2.op_ret < 0) { \
- op_errno = state->resolve2.op_errno; \
- op_ret = -1; \
- gf_log ("glusterfs-fuse", \
- GF_LOG_WARNING, \
- "%"PRIu64": %s() inode " \
- "migration of %s failed (%s)", \
- frame->root->unique, \
- gf_fop_list[frame->root->op], \
- state->resolve2.resolve_loc.path, \
- strerror (op_errno)); \
- } \
- \
- if (op_ret < 0) { \
- send_fuse_err (state->this, state->finh, op_errno); \
- free_fuse_state (state); \
- STACK_DESTROY (frame->root); \
- } else { \
- if (xl->history) \
- gf_log_eh ("%"PRIu64", %s, path: (%s), gfid: " \
- "(%s)", frame->root->unique, \
- gf_fop_list[frame->root->op], \
- state->loc.path, \
- uuid_utoa (state->loc.gfid)); \
- STACK_WIND_COOKIE (frame, ret, cky, xl, xl->fops->fop, \
- args); \
- } \
+ if (state->this->history) \
+ gf_log_eh ("%"PRIu64", %s, path: (%s), gfid: " \
+ "(%s)", frame->root->unique, \
+ gf_fop_list[frame->root->op], \
+ state->loc.path, \
+ (state->fd == NULL)? \
+ uuid_utoa (state->loc.gfid): \
+ uuid_utoa (state->fd->inode->gfid)); \
+ STACK_WIND (frame, ret, xl, xl->fops->fop, args); \
} while (0)
#define GF_SELECT_LOG_LEVEL(_errno) \
@@ -446,7 +312,6 @@
inode_t *hint;
u_char pargfid[16];
inode_t *parhint;
- char *resolved;
int op_ret;
int op_errno;
loc_t resolve_loc;
@@ -533,5 +398,6 @@
int fuse_resolve_fd_init (fuse_state_t *state, fuse_resolve_t *resolve,
fd_t *fd);
int fuse_ignore_xattr_set (fuse_private_t *priv, char *key);
+void fuse_fop_resume (fuse_state_t *state);
int dump_history_fuse (circular_buffer_t *cb, void *data);
#endif /* _GF_FUSE_BRIDGE_H_ */
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/mount/fuse/src/fuse-helpers.c
^
|
@@ -22,8 +22,6 @@
GF_FREE ((void *)resolve->bname);
- GF_FREE ((void *)resolve->resolved);
-
if (resolve->fd)
fd_unref (resolve->fd);
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/mount/fuse/src/fuse-resolve.c
^
|
@@ -653,19 +653,6 @@
}
-static int
-fuse_resolve_done (fuse_state_t *state)
-{
- fuse_resume_fn_t fn = NULL;
-
- fn = state->resume_fn;
-
- fn (state);
-
- return 0;
-}
-
-
/*
* This function is called multiple times, once per resolving one location/fd.
* state->resolve_now is used to decide which location/fd is to be resolved now
@@ -689,7 +676,7 @@
} else if (state->resolve_now == &state->resolve2) {
- fuse_resolve_done (state);
+ fuse_fop_resume (state);
} else {
gf_log ("fuse-resolve", GF_LOG_ERROR,
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/nfs/server/src/acl3.c
^
|
@@ -414,6 +414,9 @@
acl3svc_submit_reply (cs->req, (void *)&cs->args.setaclreply,
(acl3_serializer)xdr_serialize_setaclreply);
+
+ nfs3_call_state_wipe (cs);
+
return 0;
}
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/nfs/server/src/mount3.c
^
|
@@ -1922,7 +1922,7 @@
}
if (nfs->mount_udp) {
- pthread_create (&udp_thread, NULL, mount3udp_thread, NULL);
+ pthread_create (&udp_thread, NULL, mount3udp_thread, nfsx);
}
return &mnt3prog;
err:
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/nfs/server/src/mount3udp_svc.c
^
|
@@ -170,8 +170,17 @@
void *
mount3udp_thread (void *argv)
{
+ xlator_t *nfsx = NULL;
register SVCXPRT *transp = NULL;
+ GF_ASSERT (nfsx);
+
+ if (glusterfs_this_set(nfsx)) {
+ gf_log (GF_MNT, GF_LOG_ERROR, "failed to set xlator, "
+ "nfs.mount-udp will not work");
+ return NULL;
+ }
+
transp = svcudp_create(RPC_ANYSOCK);
if (transp == NULL) {
gf_log (GF_MNT, GF_LOG_ERROR, "svcudp_create error");
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/nfs/server/src/nfs-common.c
^
|
@@ -77,15 +77,15 @@
xlator_t *
nfs_mntpath_to_xlator (xlator_list_t *cl, char *path)
{
- char volname[MNTPATHLEN];
- char *volptr = NULL;
+ char *volname = NULL;
+ char *volptr = NULL;
size_t pathlen;
- xlator_t *targetxl = NULL;
+ xlator_t *targetxl = NULL;
if ((!cl) || (!path))
return NULL;
- strcpy (volname, path);
+ volname = strdupa (path);
pathlen = strlen (volname);
gf_log (GF_NFS, GF_LOG_TRACE, "Subvolume search: %s", path);
if (volname[0] == '/')
@@ -101,12 +101,9 @@
targetxl = cl->xlator;
break;
}
-
cl = cl->next;
}
-
return targetxl;
-
}
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/nfs/server/src/nfs.c
^
|
@@ -518,10 +518,11 @@
if (!this)
return NULL;
- if ((!this->children) || (!this->children->xlator)) {
- gf_log (GF_NFS, GF_LOG_ERROR, "nfs must have at least one"
- " child subvolume");
- return NULL;
+ if (!this->children) {
+ gf_log (GF_NFS, GF_LOG_INFO,
+ "NFS is manually disabled: Exiting");
+ /* Nothing for nfs process to do, exit cleanly */
+ kill (getpid (), SIGTERM);
}
nfs = GF_CALLOC (1, sizeof (*nfs), gf_nfs_mt_nfs_state);
@@ -738,10 +739,10 @@
GF_OPTION_INIT (OPT_SERVER_GID_CACHE_TIMEOUT, nfs->server_aux_gids_max_age,
uint32, free_foppool);
- if (gid_cache_init(&nfs->gid_cache, nfs->server_aux_gids_max_age) < 0) {
- gf_log(GF_NFS, GF_LOG_ERROR, "Failed to initialize group cache.");
- goto free_foppool;
- }
+ if (gid_cache_init(&nfs->gid_cache, nfs->server_aux_gids_max_age) < 0) {
+ gf_log(GF_NFS, GF_LOG_ERROR, "Failed to initialize group cache.");
+ goto free_foppool;
+ }
if (stat("/sbin/rpc.statd", &stbuf) == -1) {
gf_log (GF_NFS, GF_LOG_WARNING, "/sbin/rpc.statd not found. "
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/nfs/server/src/nlm4.c
^
|
@@ -941,7 +941,7 @@
case AF_INET:
inet_ntop (AF_INET, &sock_union.sin.sin_addr, peerip,
INET6_ADDRSTRLEN+1);
- inet_ntop (AF_INET, &(((struct sockaddr_in *)&cs->req->trans->myinfo.sockaddr)->sin_addr),
+ inet_ntop (AF_INET, &(((struct sockaddr_in *)&cs->trans->myinfo.sockaddr)->sin_addr),
myip, INET6_ADDRSTRLEN + 1);
break;
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/performance/quick-read/src/quick-read.c
^
|
@@ -543,8 +543,6 @@
LOCK (&table->lock);
{
- op_ret = -1;
-
if (!qr_inode->data)
goto unlock;
@@ -565,7 +563,6 @@
iobref = iobref_new ();
if (!iobref) {
op_ret = -1;
- iobuf_unref (iobuf);
goto unlock;
}
@@ -581,19 +578,17 @@
unlock:
UNLOCK (&table->lock);
- if (op_ret > 0) {
+ if (op_ret >= 0) {
iov.iov_base = iobuf->ptr;
iov.iov_len = op_ret;
-
STACK_UNWIND_STRICT (readv, frame, op_ret, 0, &iov, 1,
&buf, iobref, xdata);
}
+ if (iobuf)
+ iobuf_unref (iobuf);
- if (iobuf)
- iobuf_unref (iobuf);
-
- if (iobref)
- iobref_unref (iobref);
+ if (iobref)
+ iobref_unref (iobref);
return op_ret;
}
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/storage/bd_map/src/bd_map.c
^
|
@@ -1500,11 +1500,10 @@
op_ret = 0;
out:
- if (op_ret == -1) {
+ if (op_ret == -1 && bd_fd) {
BD_PUT_ENTRY (priv, bd_fd->p_entry);
- if (bd_fd)
- GF_FREE (bd_fd);
}
+ GF_FREE (bd_fd);
STACK_UNWIND_STRICT (opendir, frame, op_ret, op_errno, fd, NULL);
return 0;
@@ -1725,7 +1724,7 @@
BD_RD_LOCK (bd_lock);
- bdentry = list_entry ((&bd_fd->p_entry->child)->next, typeof(*n_entry),
+ bdentry = list_entry ((&bd_fd->p_entry->child)->next, bd_entry_t,
child);
if (off) {
@@ -1738,7 +1737,7 @@
}
} else
bd_fd->entry = list_entry ((&bdentry->sibling),
- typeof(*n_entry), sibling);
+ bd_entry_t, sibling);
while (filled <= size) {
cur_entry = bd_fd->entry;
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/storage/posix/src/posix-handle.c
^
|
@@ -284,7 +284,6 @@
struct posix_private *priv = NULL;
char *handle_pfx = NULL;
int ret = 0;
- int len = 0;
struct stat stbuf;
struct stat rootbuf;
struct stat exportbuf;
@@ -337,9 +336,7 @@
stat (handle_pfx, &priv->handledir);
- len = posix_handle_path (this, gfid, NULL, NULL, 0);
- rootstr = alloca (len);
- posix_handle_path (this, gfid, NULL, rootstr, len);
+ MAKE_HANDLE_ABSPATH(rootstr, this, gfid);
ret = stat (rootstr, &rootbuf);
switch (ret) {
@@ -529,7 +526,7 @@
int ret = -1;
- MAKE_HANDLE_PATH (newpath, this, gfid, NULL);
+ MAKE_HANDLE_ABSPATH (newpath, this, gfid);
ret = lstat (newpath, &newbuf);
if (ret == -1 && errno != ENOENT) {
@@ -603,11 +600,9 @@
struct stat newbuf;
int ret = -1;
-
- MAKE_HANDLE_PATH (newpath, this, gfid, NULL);
+ MAKE_HANDLE_ABSPATH (newpath, this, gfid);
MAKE_HANDLE_RELPATH (oldpath, this, loc->pargfid, loc->name);
-
ret = lstat (newpath, &newbuf);
if (ret == -1 && errno != ENOENT) {
gf_log (this->name, GF_LOG_WARNING,
@@ -665,7 +660,7 @@
}
-static int
+int
posix_handle_unset_gfid (xlator_t *this, uuid_t gfid)
{
char *path = NULL;
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/storage/posix/src/posix-handle.h
^
|
@@ -19,6 +19,10 @@
#include "xlator.h"
+#define HANDLE_ABSPATH_LEN(this) (POSIX_BASE_PATH_LEN(this) + \
+ SLEN("/" GF_HIDDEN_PATH "/00/00/" \
+ UUID0_STR) + 1)
+
#define LOC_HAS_ABSPATH(loc) ((loc) && (loc->path) && (loc->path[0] == '/'))
#define MAKE_REAL_PATH(var, this, path) do { \
@@ -58,6 +62,15 @@
} while (0)
+#define MAKE_HANDLE_ABSPATH(var, this, gfid) do { \
+ struct posix_private * __priv = this->private; \
+ int __len = HANDLE_ABSPATH_LEN(this); \
+ var = alloca(__len); \
+ snprintf(var, __len, "%s/" GF_HIDDEN_PATH "/%02x/%02x/%s", \
+ __priv->base_path, gfid[0], gfid[1], uuid_utoa(gfid)); \
+ } while (0)
+
+
#define MAKE_INODE_HANDLE(rpath, this, loc, iatt_p) do { \
if (uuid_is_null (loc->gfid)) { \
gf_log (this->name, GF_LOG_ERROR, \
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/storage/posix/src/posix-helpers.c
^
|
@@ -449,6 +449,24 @@
return xattr;
}
+void
+posix_gfid_unset (xlator_t *this, dict_t *xdata)
+{
+ uuid_t uuid = {0, };
+ int ret = 0;
+
+ if (xdata == NULL)
+ goto out;
+
+ ret = dict_get_ptr (xdata, "gfid-req", (void **)&uuid);
+ if (ret) {
+ goto out;
+ }
+
+ posix_handle_unset (this, uuid, NULL);
+out:
+ return;
+}
int
posix_gfid_set (xlator_t *this, const char *path, loc_t *loc, dict_t *xattr_req)
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/storage/posix/src/posix.c
^
|
@@ -728,18 +728,18 @@
posix_mknod (call_frame_t *frame, xlator_t *this,
loc_t *loc, mode_t mode, dev_t dev, mode_t umask, dict_t *xdata)
{
- int tmp_fd = 0;
- int32_t op_ret = -1;
- int32_t op_errno = 0;
- char *real_path = 0;
- char *par_path = 0;
- struct iatt stbuf = { 0, };
- char was_present = 1;
- struct posix_private *priv = NULL;
- gid_t gid = 0;
- struct iatt preparent = {0,};
- struct iatt postparent = {0,};
- void * uuid_req = NULL;
+ int tmp_fd = 0;
+ int32_t op_ret = -1;
+ int32_t op_errno = 0;
+ char *real_path = 0;
+ char *par_path = 0;
+ struct iatt stbuf = { 0, };
+ struct posix_private *priv = NULL;
+ gid_t gid = 0;
+ struct iatt preparent = {0,};
+ struct iatt postparent = {0,};
+ void * uuid_req = NULL;
+ gf_boolean_t entry_created = _gf_false, gfid_set = _gf_false;
DECLARE_OLD_FS_ID_VAR;
@@ -817,10 +817,14 @@
}
}
+ entry_created = _gf_true;
+
op_ret = posix_gfid_set (this, real_path, loc, xdata);
if (op_ret) {
gf_log (this->name, GF_LOG_ERROR,
"setting gfid on %s failed", real_path);
+ } else {
+ gfid_set = _gf_true;
}
#ifndef HAVE_SET_FSID
@@ -876,28 +880,35 @@
(loc)?loc->inode:NULL, &stbuf, &preparent,
&postparent, NULL);
- if ((op_ret == -1) && (!was_present)) {
- unlink (real_path);
+ if (op_ret < 0) {
+ if (entry_created) {
+ if (S_ISREG (mode))
+ sys_unlink (real_path);
+ else
+ sys_rmdir (real_path);
+ }
+
+ if (gfid_set)
+ posix_gfid_unset (this, xdata);
}
return 0;
}
-
int
posix_mkdir (call_frame_t *frame, xlator_t *this,
loc_t *loc, mode_t mode, mode_t umask, dict_t *xdata)
{
- int32_t op_ret = -1;
- int32_t op_errno = 0;
- char *real_path = NULL;
- char *par_path = NULL;
- struct iatt stbuf = {0, };
- char was_present = 1;
- struct posix_private *priv = NULL;
- gid_t gid = 0;
- struct iatt preparent = {0,};
- struct iatt postparent = {0,};
+ int32_t op_ret = -1;
+ int32_t op_errno = 0;
+ char *real_path = NULL;
+ char *par_path = NULL;
+ struct iatt stbuf = {0, };
+ struct posix_private *priv = NULL;
+ gid_t gid = 0;
+ struct iatt preparent = {0,};
+ struct iatt postparent = {0,};
+ gf_boolean_t entry_created = _gf_false, gfid_set = _gf_false;
DECLARE_OLD_FS_ID_VAR;
@@ -925,9 +936,6 @@
gid = frame->root->gid;
op_ret = posix_pstat (this, NULL, real_path, &stbuf);
- if ((op_ret == -1) && (errno == ENOENT)) {
- was_present = 0;
- }
SET_FS_ID (frame->root->uid, gid);
@@ -954,10 +962,14 @@
goto out;
}
+ entry_created = _gf_true;
+
op_ret = posix_gfid_set (this, real_path, loc, xdata);
if (op_ret) {
gf_log (this->name, GF_LOG_ERROR,
"setting gfid on %s failed", real_path);
+ } else {
+ gfid_set = _gf_true;
}
#ifndef HAVE_SET_FSID
@@ -1012,27 +1024,71 @@
(loc)?loc->inode:NULL, &stbuf, &preparent,
&postparent, NULL);
- if ((op_ret == -1) && (!was_present)) {
- unlink (real_path);
+ if (op_ret < 0) {
+ if (entry_created)
+ sys_rmdir (real_path);
+
+ if (gfid_set)
+ posix_gfid_unset (this, xdata);
}
return 0;
}
+int32_t
+posix_unlink_gfid_handle_and_entry (xlator_t *this, const char *real_path,
+ struct iatt *stbuf, int32_t *op_errno)
+{
+ int32_t ret = 0;
+
+ /* Unlink the gfid_handle_first */
+
+ if (stbuf && stbuf->ia_nlink == 1) {
+ ret = posix_handle_unset (this, stbuf->ia_gfid, NULL);
+ if (ret) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "unlink of gfid handle failed for path:%s with"
+ "gfid %s with errno:%s", real_path,
+ uuid_utoa (stbuf->ia_gfid), strerror (errno));
+ }
+ }
+
+ /* Unlink the actual file */
+ ret = sys_unlink (real_path);
+ if (ret == -1) {
+ if (op_errno)
+ *op_errno = errno;
+
+ gf_log (this->name, GF_LOG_ERROR,
+ "unlink of %s failed: %s", real_path,
+ strerror (errno));
+ goto err;
+ }
+
+ return 0;
+
+err:
+ return -1;
+}
int32_t
posix_unlink (call_frame_t *frame, xlator_t *this,
loc_t *loc, int xflag, dict_t *xdata)
{
- int32_t op_ret = -1;
- int32_t op_errno = 0;
- char *real_path = NULL;
- char *par_path = NULL;
- int32_t fd = -1;
- struct iatt stbuf = {0,};
- struct posix_private *priv = NULL;
- struct iatt preparent = {0,};
- struct iatt postparent = {0,};
+ int32_t op_ret = -1;
+ int32_t op_errno = 0;
+ char *real_path = NULL;
+ char *par_path = NULL;
+ int32_t fd = -1;
+ struct iatt stbuf = {0,};
+ struct posix_private *priv = NULL;
+ struct iatt preparent = {0,};
+ struct iatt postparent = {0,};
+ int32_t unlink_if_linkto = 0;
+ int32_t check_open_fd = 0;
+ int32_t skip_unlink = 0;
+ ssize_t xattr_size = -1;
+ int32_t is_dht_linkto_file = 0;
DECLARE_OLD_FS_ID_VAR;
@@ -1052,10 +1108,62 @@
goto out;
}
- if (stbuf.ia_nlink == 1)
- posix_handle_unset (this, stbuf.ia_gfid, NULL);
-
priv = this->private;
+
+ op_ret = dict_get_int32 (xdata, DHT_SKIP_OPEN_FD_UNLINK,
+ &check_open_fd);
+
+ if (!op_ret && check_open_fd) {
+
+ LOCK (&loc->inode->lock);
+
+ if (loc->inode->fd_count) {
+ skip_unlink = 1;
+ }
+
+ UNLOCK (&loc->inode->lock);
+
+ gf_log (this->name, GF_LOG_INFO, "open-fd-key-status: "
+ "%"PRIu32" for %s", skip_unlink, real_path);
+
+ if (skip_unlink) {
+ op_ret = -1;
+ op_errno = EBUSY;
+ goto out;
+ }
+ }
+
+
+ op_ret = dict_get_int32 (xdata, DHT_SKIP_NON_LINKTO_UNLINK,
+ &unlink_if_linkto);
+
+ if (!op_ret && unlink_if_linkto) {
+
+ LOCK (&loc->inode->lock);
+
+ xattr_size = sys_lgetxattr (real_path, LINKTO, NULL, 0);
+
+ if (xattr_size <= 0) {
+ skip_unlink = 1;
+ } else {
+ is_dht_linkto_file = IS_DHT_LINKFILE_MODE (&stbuf);
+ if (!is_dht_linkto_file)
+ skip_unlink = 1;
+ }
+
+ UNLOCK (&loc->inode->lock);
+
+ gf_log (this->name, GF_LOG_INFO, "linkto_xattr status: "
+ "%"PRIu32" for %s", skip_unlink, real_path);
+
+ if (skip_unlink) {
+ op_ret = -1;
+ op_errno = EBUSY;
+ goto out;
+ }
+ }
+
+
if (priv->background_unlink) {
if (IA_ISREG (loc->inode->ia_type)) {
fd = open (real_path, O_RDONLY);
@@ -1070,12 +1178,9 @@
}
}
- op_ret = sys_unlink (real_path);
+ op_ret = posix_unlink_gfid_handle_and_entry (this, real_path, &stbuf,
+ &op_errno);
if (op_ret == -1) {
- op_errno = errno;
- gf_log (this->name, GF_LOG_ERROR,
- "unlink of %s failed: %s", real_path,
- strerror (op_errno));
goto out;
}
@@ -1211,16 +1316,16 @@
posix_symlink (call_frame_t *frame, xlator_t *this,
const char *linkname, loc_t *loc, mode_t umask, dict_t *xdata)
{
- int32_t op_ret = -1;
- int32_t op_errno = 0;
- char * real_path = 0;
- char * par_path = 0;
- struct iatt stbuf = { 0, };
- struct posix_private *priv = NULL;
- gid_t gid = 0;
- char was_present = 1;
- struct iatt preparent = {0,};
- struct iatt postparent = {0,};
+ int32_t op_ret = -1;
+ int32_t op_errno = 0;
+ char * real_path = 0;
+ char * par_path = 0;
+ struct iatt stbuf = { 0, };
+ struct posix_private *priv = NULL;
+ gid_t gid = 0;
+ struct iatt preparent = {0,};
+ struct iatt postparent = {0,};
+ gf_boolean_t entry_created = _gf_false, gfid_set = _gf_false;
DECLARE_OLD_FS_ID_VAR;
@@ -1234,10 +1339,6 @@
MAKE_ENTRY_HANDLE (real_path, par_path, this, loc, &stbuf);
- if ((op_ret == -1) && (errno == ENOENT)){
- was_present = 0;
- }
-
SET_FS_ID (frame->root->uid, gid);
gid = frame->root->gid;
@@ -1265,10 +1366,14 @@
goto out;
}
+ entry_created = _gf_true;
+
op_ret = posix_gfid_set (this, real_path, loc, xdata);
if (op_ret) {
gf_log (this->name, GF_LOG_ERROR,
"setting gfid on %s failed", real_path);
+ } else {
+ gfid_set = _gf_true;
}
#ifndef HAVE_SET_FSID
@@ -1323,8 +1428,12 @@
(loc)?loc->inode:NULL, &stbuf, &preparent,
&postparent, NULL);
- if ((op_ret == -1) && (!was_present)) {
- unlink (real_path);
+ if (op_ret < 0) {
+ if (entry_created)
+ sys_unlink (real_path);
+
+ if (gfid_set)
+ posix_gfid_unset (this, xdata);
}
return 0;
@@ -1479,10 +1588,6 @@
&preoldparent, &postoldparent,
&prenewparent, &postnewparent, NULL);
- if ((op_ret == -1) && !was_present) {
- unlink (real_newpath);
- }
-
return 0;
}
@@ -1491,16 +1596,16 @@
posix_link (call_frame_t *frame, xlator_t *this,
loc_t *oldloc, loc_t *newloc, dict_t *xdata)
{
- int32_t op_ret = -1;
- int32_t op_errno = 0;
- char *real_oldpath = 0;
- char *real_newpath = 0;
- char *par_newpath = 0;
- struct iatt stbuf = {0, };
- struct posix_private *priv = NULL;
- char was_present = 1;
- struct iatt preparent = {0,};
- struct iatt postparent = {0,};
+ int32_t op_ret = -1;
+ int32_t op_errno = 0;
+ char *real_oldpath = 0;
+ char *real_newpath = 0;
+ char *par_newpath = 0;
+ struct iatt stbuf = {0, };
+ struct posix_private *priv = NULL;
+ struct iatt preparent = {0,};
+ struct iatt postparent = {0,};
+ gf_boolean_t entry_created = _gf_false;
DECLARE_OLD_FS_ID_VAR;
@@ -1516,9 +1621,6 @@
MAKE_INODE_HANDLE (real_oldpath, this, oldloc, &stbuf);
MAKE_ENTRY_HANDLE (real_newpath, par_newpath, this, newloc, &stbuf);
- if ((op_ret == -1) && (errno == ENOENT)) {
- was_present = 0;
- }
op_ret = posix_pstat (this, newloc->pargfid, par_newpath, &preparent);
if (op_ret == -1) {
@@ -1548,6 +1650,8 @@
goto out;
}
+ entry_created = _gf_true;
+
op_ret = posix_pstat (this, NULL, real_newpath, &stbuf);
if (op_ret == -1) {
op_errno = errno;
@@ -1574,8 +1678,9 @@
(oldloc)?oldloc->inode:NULL, &stbuf, &preparent,
&postparent, NULL);
- if ((op_ret == -1) && (!was_present)) {
- unlink (real_newpath);
+ if (op_ret < 0) {
+ if (entry_created)
+ sys_unlink (real_newpath);
}
return 0;
@@ -1647,20 +1752,21 @@
loc_t *loc, int32_t flags, mode_t mode,
mode_t umask, fd_t *fd, dict_t *xdata)
{
- int32_t op_ret = -1;
- int32_t op_errno = 0;
- int32_t _fd = -1;
- int _flags = 0;
- char * real_path = NULL;
- char * par_path = NULL;
- struct iatt stbuf = {0, };
- struct posix_fd * pfd = NULL;
- struct posix_private * priv = NULL;
- char was_present = 1;
-
- gid_t gid = 0;
- struct iatt preparent = {0,};
- struct iatt postparent = {0,};
+ int32_t op_ret = -1;
+ int32_t op_errno = 0;
+ int32_t _fd = -1;
+ int _flags = 0;
+ char * real_path = NULL;
+ char * par_path = NULL;
+ struct iatt stbuf = {0, };
+ struct posix_fd * pfd = NULL;
+ struct posix_private * priv = NULL;
+ char was_present = 1;
+
+ gid_t gid = 0;
+ struct iatt preparent = {0,};
+ struct iatt postparent = {0,};
+ gf_boolean_t entry_created = _gf_false, gfid_set = _gf_false;
DECLARE_OLD_FS_ID_VAR;
@@ -1718,6 +1824,11 @@
goto out;
}
+ if ((_flags & O_CREAT) && (_flags & O_EXCL)) {
+ entry_created = _gf_true;
+ }
+
+
if (was_present)
goto fill_stat;
@@ -1725,6 +1836,8 @@
if (op_ret) {
gf_log (this->name, GF_LOG_ERROR,
"setting gfid on %s failed", real_path);
+ } else {
+ gfid_set = _gf_true;
}
#ifndef HAVE_SET_FSID
@@ -1798,16 +1911,20 @@
if ((-1 == op_ret) && (_fd != -1)) {
close (_fd);
-
- if (!was_present) {
- unlink (real_path);
- }
}
STACK_UNWIND_STRICT (create, frame, op_ret, op_errno,
fd, (loc)?loc->inode:NULL, &stbuf, &preparent,
&postparent, xdata);
+ if (op_ret < 0) {
+ if (entry_created)
+ sys_unlink (real_path);
+
+ if (gfid_set)
+ posix_gfid_unset (this, xdata);
+ }
+
return 0;
}
|
[-]
[+]
|
Changed |
glusterfs-3.4.6.tar.gz/xlators/storage/posix/src/posix.h
^
|
@@ -49,6 +49,16 @@
#include "posix-aio.h"
#endif
+#define VECTOR_SIZE 64 * 1024 /* vector size 64KB*/
+#define MAX_NO_VECT 1024
+
+#define LINKTO "trusted.glusterfs.dht.linkto"
+
+#define POSIX_GFID_HANDLE_SIZE(base_path_len) (base_path_len + SLEN("/") \
+ + SLEN(GF_HIDDEN_PATH) + SLEN("/") \
+ + SLEN("00/") \
+ + SLEN("00/") + SLEN(UUID0_STR) + 1) /* '\0' */;
+
/**
* posix_fd - internal structure common to file and directory fd's
*/
@@ -174,4 +184,8 @@
void
__posix_fd_set_odirect (fd_t *fd, struct posix_fd *pfd, int opflags,
off_t offset, size_t size);
+
+void
+posix_gfid_unset (xlator_t *this, dict_t *xdata);
+
#endif /* _POSIX_H */
|