summaryrefslogtreecommitdiffstats
path: root/xlators/features
Commit message (Collapse)AuthorAgeFilesLines
* build: export minimum symbols from xlators for correct resolutionKaleb S. KEITHLEY2015-09-2427-29/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | We've been lucky that we haven't had any symbol collisions until now. Now we have a collision between the snapview-client's svc_lookup() and libntirpc's svc_lookup() with nfs-ganesha's FSAL_GLUSTER and libgfapi. As a short term solution all the snapview-client's FOP methods were changed to static scope. See http://review.gluster.org/11805. This works in snapview-client because all the FOP methods are defined in a single source file. This solution doesn't work for other xlators with FOP methods defined in multiple source files. To address this we link with libtool's '-export-symbols $symbol-file' (a wrapper around `ld --version-script ...` --- on linux anyway) and only export the minimum required symbols from the xlator sharedlib. N.B. the libtool man page says that the symbol file should be named foo.sym, thus the rename of *.exports to *.sym. While foo.exports worked, we will follow the documentation. Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> BUG: 1248669 Change-Id: I1de68b3e3be58ae690d8bfb2168bfc019983627c Reviewed-on: http://review.gluster.org/11814 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: soumya k <skoduri@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* features/shard: Performance improvements in IO path - Part 2Krutika Dhananjay2015-09-221-0/+80
| | | | | | | | | | | | | | | | This is change 2/2 of the performance improvements for sharding. The changes are with respect to maintaining up-to-date values of file attributes in [f]stat, [f]setattr, link, and [f]truncate codepaths. Change-Id: Ia3ce4664fb33be869e4dc76494adbe9c314cc098 BUG: 1258905 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/12138 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
* features/shard: Performance improvements in IO pathKrutika Dhananjay2015-09-222-70/+233
| | | | | | | | | | | | | | | | | | | | | | | | This is patch 1/2 of the performance improvement work for sharding in the IO path. What this patch does: Since the primary use-case where sharding is targeted - VM store - is a single-writer workload, instead of performing lookup on the base file everytime to gather the size and block count from the backend in reads, writes and truncate, now the size and block count is also cached and kept up-to-date after every inode write in the inode ctx. TO-DO: Make changes in rename, link, unlink, [f]setattr and [f]stat to keep the relevant iatt members up-to-date in the inode ctx. Change-Id: Ica87d020dabc3a3dbccec814b26b01d6a629ff4d BUG: 1258905 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/12126 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* marker: don't account destination linkto-file during internal migrationvmallika2015-09-224-47/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | During a DHT re-balance operation, quota accounts for the destination. Problem of accounting this destination file are: 1) Migration is an internal operation, 'quota list' shows more usage on the CLI and this will come to the normal numbers once the migration is complete 2) If the usage is close to the limit set, then we can get 'Disk Quota Exceeded' errors in the I/O path during file migration Solution is we should not account of the usage on the destination file during migration, at the end of the migration. We need to reduce size of the source directory and accounting for the migrated dest file We assume that there are sufficent disk space in the back-end. DHT migrator should make sure that there are sufficient disk space before it starts the migration process. Change-Id: Ie3cfe3e4ab5241c2a127ba0edc599a053d30c3a0 BUG: 1260545 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/12113 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Dan Lambright <dlambrig@redhat.com>
* BZ 789278: Coverity bug fixes for logically dead codeAkhil Bhansali2015-09-151-29/+0
| | | | | | | | | | | | | | | | | Removing the logically dead code as reported by coverity tool run on GlusterFS. The code changes are removal of logically dead code, hence did not run the testcases. CIDs Fixed starts from 1292652 to 1292663 in sequence. Signed-off-by: Akhil Bhansali <bhansaliakhil@gmail.com> Change-Id: I05b35f744c89b5e49b6322635c7a0d367ef10abb BUG: 789278 Reviewed-on: http://review.gluster.org/12150 Reviewed-by: Anoop C S <anoopcs@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/shard: Add appropriate NULL checks to prevent excessive loggingKrutika Dhananjay2015-09-131-29/+47
| | | | | | | | | | | | | | | | Also, 1) the getxattr() callback must check for the fop return status before attempting to delete the internal keys. 2) the correct dict was not being used in shard_getxattr_cbk(). This patch also fixes that issue. Change-Id: I516a1d98e112b572bcec7d1f1e03e23152567be3 BUG: 1260637 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/12136 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* features/shard: Do not return non-negative status on failure in writevKrutika Dhananjay2015-09-091-1/+1
| | | | | | | | | Change-Id: I5f65c49484e44a05bb7df53c73869f89ad3392e0 BUG: 1261399 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/12140 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* features/shard: Filter internal shard xattrs in {get,remove,set}xattrKrutika Dhananjay2015-09-082-0/+150
| | | | | | | | | Change-Id: I40e4a5dbd13d6c3d777e7e01f93dabc83e52b137 BUG: 1260637 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/12121 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
* tier/ctr: Solving DB Lock issue due to write contention from db connectionsJoseph Fernandes2015-09-082-1/+34
| | | | | | | | | | | | | | | | | | | | | | | Problem: The DB on the brick is been accessed by CTR, for write and tier migrator, for read and write. The write from tier migrator is reseting the heat counters after a cycle. Since we are using sqlite, two connections trying to write would cause a db lock contention. As a result CTR used to fail to update the db. Solution: Using the same db connection of CTR for reseting the heat counters. 1) Introducted a new IPC FOP for CTR 2) After the query do a ipc syncop to the underlying client xlator associated to the brick. 3) CTR in brick will catch the IPC FOP and cleat the heat counters. Change-Id: I53306bfc08dcdba479deb4ccc154896521336150 BUG: 1260730 Signed-off-by: Joseph Fernandes <josferna@redhat.com> Reviewed-on: http://review.gluster.org/12031 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Dan Lambright <dlambrig@redhat.com>
* uss : handle `buf` variable properly in svs_glfs_readdir()Jiffin Tony Thottan2015-09-071-3/+3
| | | | | | | | | | | | | | | | The svs_glfs_readdir() is a generic function which is called from svs_readdir() and svs_readdirp(). But in svs_readdir 'buf' variable is passed as NULL, then glfs_read_readdir() will fail. This patch will fix the same. Change-Id: Id02e4e17e30c85de117db5ddd9f97b578622dff9 BUG: 1260611 Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com> Reviewed-on: http://review.gluster.org/12117 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/shard: Fix incorrect op_ret in READVKrutika Dhananjay2015-09-031-2/+8
| | | | | | | | | Change-Id: I31ac99b290f82f4b74236c206193f7641c73d4dc BUG: 1259651 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/12099 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
* all: reduce "inline" usageJeff Darcy2015-09-0118-151/+90
| | | | | | | | | | | | | | | | | | | | | | | | | There are three kinds of inline functions: plain inline, extern inline, and static inline. All three have been removed from .c files, except those in "contrib" which aren't our problem. Inlines in .h files, which are overwhelmingly "static inline" already, have generally been left alone. Over time we should be able to "lower" these into .c files, but that has to be done in a case-by-case fashion requiring more manual effort. This part was easy to do automatically without (as far as I can tell) any ill effect. In the process, several pieces of dead code were flagged by the compiler, and were removed. Change-Id: I56a5e614735c9e0a6ee420dab949eac22e25c155 BUG: 1245331 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/11769 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Venky Shankar <vshankar@redhat.com>
* features/shard: Fix unlink failure due to non-existent shard(s)Krutika Dhananjay2015-08-311-4/+3
| | | | | | | | | | | | | | | | | | | | Unlink of a sharded file with holes was leading to EINVAL errors because it was being wound on non-existent shards (those blocks that fall in the hole region). loc->inode was NULL in these cases and dht_unlink used to fail the FOP with EINVAL for failure to fetch cached subvol for the inode. The fix involves winding unlink on only those shards whose corresponding inodes exist in memory. Change-Id: I993ff70cab4b22580c772a9c74fc19ac893a03fc BUG: 1258334 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/12059 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/shard: Fix permission issuesKrutika Dhananjay2015-08-302-8/+57
| | | | | | | | | | | | | | | | | | | | This patch does the following: * reverts commit b467af0e99b39ef708420d3f7f6696b0ca618512 * changes ownership on shards under /.shard to be root:root * makes readv, writev, [f]truncate, rename, and unlink fops to perform operations on files under /.shard with frame->root->{uid,gid} as 0. This would ensure that a [f]setattr on a sharded file does not need to be called on all the shards associated with it. Change-Id: Idcfb8c0dd354b0baab6b2356d2ab83ce51caa20e BUG: 1251824 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/11992 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* features/shard: Fix size update for writes at hole regionKrutika Dhananjay2015-08-292-2/+10
| | | | | | | | | | Change-Id: Iceccef8f3f466c7ffb9991f8eb248b81e7b80efb BUG: 1256580 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/12020 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* marker: preserve previous dirty flag during update txnvmallika2015-08-291-15/+91
| | | | | | | | | | | | | | | | | | In case if dir has become dirty because of brick crash, this dirty flag on disk was getting reset in the next update txn. This patch now gets the dirty flag before setting the flag in the update txn and if this value is dirty, it keeps the flag dirty, so that inspect_directory can fix the dirty dir Change-Id: Iab2c343dbe19bd3b291adbfeebe6d9785b6bb9e3 BUG: 1251454 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/12032 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* fd: Do fd_bind on successful openPranith Kumar K2015-08-282-1/+7
| | | | | | | | | | | | | | | - fd_unref should decrement fd->inode->fd_count only if it is present in the inode's fd list. - successful open/opendir should perform fd_bind. Change-Id: I81dd04f330e2fee86369a6dc7147af44f3d49169 BUG: 1207735 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/11044 Reviewed-by: Anoop C S <anoopcs@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* marker: fix log when loc.parent and inode gfid is NULLvmallika2015-08-272-89/+168
| | | | | | | | | | | | | | | | | This patch does the following 1) Set loc.parent if it is NULL Don't log warning in txn if parent is NULL 2) Don't initiate txn when inode gfid is NULL 3) optimize invoking dirty txn with status flag Change-Id: I67dd9e6268014b0b257c136e951e6ded0a2e911f BUG: 1251454 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/11863 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* snapshot: Make fops static for correct resolution of symbolsSoumya Koduri2015-08-241-36/+38
| | | | | | | | | | | | | | | Few of the snapshot fops (like 'svc_lookup') may not get resolved while using dynamic loading as there could be other libraries(like libntirpc) with same routine names. Making them static to resolve the same. Change-Id: I6577bf3705864f5583425c94427b4e1025a59bcd BUG: 1248669 Signed-off-by: Soumya Koduri <skoduri@redhat.com> Reviewed-on: http://review.gluster.org/11805 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* libgfapi: adding 'follow' flag to glfs_h_lookupat()Jiffin Tony Thottan2015-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously glfs_h_lookupat won't follow the symlink, this patch introduces new flag `follow` which will resolve the same. Applications linking against the new library will need to use the new glfs_h_lookupat API call. In order to stay compatible with existing binaries that use the previous glfs_h_lookupat() function, the old symbol needs to stay available. Verification that there are two versions of glfs_h_lookupat: $ objdump -T /usr/lib64/libgfapi.so.0 | grep -w glfs_h_lookupat 0000000000015070 g DF .text 000000000000021e GFAPI_3.7.4 glfs_h_lookupat 0000000000015290 g DF .text 0000000000000008 (GFAPI_3.4.2) glfs_h_lookupat Testing with a binary (based on anonymous_fd_read_write.c from ./tests/) that was linked against the old library: $ objdump -T ./lookupat | grep -w glfs_h_lookupat 0000000000000000 DF *UND* 0000000000000000 GFAPI_3.4.2 glfs_h_lookupat Enable debugging for 'ld.so' so that we can check that the GFAPI_3.4.2 version of the symbol gets loaded: $ export LD_DEBUG_OUTPUT=lookupat.ld.log LD_DEBUG=all $ ./lookupat $ grep -w glfs_h_lookupat lookupat.ld.log.2543 2543: symbol=glfs_h_lookupat; lookup in file=./lookupat [0] 2543: symbol=glfs_h_lookupat; lookup in file=/lib64/libgfapi.so.0 [0] 2543: binding file ./lookupat [0] to /lib64/libgfapi.so.0 [0]: normal symbol `glfs_h_lookupat' [GFAPI_3.4.2] Change-Id: I8bf9b1c19a0585f681bc1a7f84aad1ccd0f75f6a BUG: 1252410 Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com> Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/11883 Reviewed-by: soumya k <skoduri@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
* features/bitrot: Fix scrubber frequency setKotresh HR2015-08-232-5/+22
| | | | | | | | | | | | | | | | | | | | | When bitrot is configured on multiple volumes in a cluster and scrubber-frequency is changed for one volume, it is resetting frequency for all other volumes w.r.t to its scrubber-frequency. This should not happen. Changing scrubber-frequency should affect only that volume on which it is set. This patch fixes the issue. Also restricted the logs to the configure volume. Change-Id: I90d6e864b131e3d8dd4010079a00f924032f2098 BUG: 1252825 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/11897 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Venky Shankar <vshankar@redhat.com>
* bitrot: Scrubber log should mark bad file as a ALERT in the scrubber logGaurav Kumar Garg2015-08-201-2/+2
| | | | | | | | | | | | If bad file detected by scrubber then scrubber should log that bad file as a ALERT message in scrubber log. Change-Id: I410429e78fd3768655230ac028fa66f7fc24b938 BUG: 1240218 Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/11965 Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
* quota/marker: fix inode quota with renamevmallika2015-08-195-532/+484
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are three problems with marker-rename which is fixed in this patch Problem 1) 1) mq_reduce_parent_size is not handling inode-quota contribution 2) When dest files exists and IO is happening Now renaming will overwrite existing file mq_reduce_parent_size called on dest file with saved contribution, this can be a problem is IO is still happening contribution might have changed Problem 2) There is a small race between rename and in-progress write Consider below scenario 1) rename FOP invoked on file 'x' 2) write is still in progress for file 'x' 3) rename takes a lock on old-parent 4) write-update txn blocked on old-parent to acquire lock 5) in rename_cbk, contri xattrs are removed and contribution is deleted and lock is released 6) now write-update txn gets the lock and updates the wrong parent as it was holding lock on old parent so validate parent once the lock is acquired Problem 3) when a rename operation is performed, a lock is held on old parent. This lock is release before unwinding the rename operation. This can be a problem if there are in-progress writes happening during rename, where update txn can take a lock and update the old parent as inode table is not updated with new parent Change-Id: Ic3316097c001c33533f98592e8fcf234b1ee2aa2 BUG: 1240991 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/11578 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* features/shard: Ensure shards are owned by the same owner/group as the ↵Krutika Dhananjay2015-08-192-31/+45
| | | | | | | | | | | | original file Change-Id: Id759af8f3ff5fd8bfa9f8121bab25722709d42b7 BUG: 1251824 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/11874 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* rpc: add owner xlator argument to rpc_clnt_newKrishnan Parthasarathi2015-08-123-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The @owner argument tells RPC layer the xlator that owns the connection and to which xlator THIS needs be set during network notifications like CONNECT and DISCONNECT. Code paths that originate from the head of a (volume) graph and use STACK_WIND ensure that the RPC local endpoint has the right xlator saved in the frame of the call (callback pair). This guarantees that the callback is executed in the right xlator context. The client handshake process which includes fetching of brick ports from glusterd, setting lk-version on the brick for the session, don't have the correct xlator set in their frames. The problem lies with RPC notifications. It doesn't have the provision to set THIS with the xlator that is registered with the corresponding RPC programs. e.g, RPC_CLNT_CONNECT event received by protocol/client doesn't have THIS set to its xlator. This implies, call(-callbacks) originating from this thread don't have the right xlator set too. The fix would be to save the xlator registered with the RPC connection during rpc_clnt_new. e.g, protocol/client's xlator would be saved with the RPC connection that it 'owns'. RPC notifications such as CONNECT, DISCONNECT, etc inherit THIS from the RPC connection's xlator. Change-Id: I9dea2c35378c511d800ef58f7fa2ea5552f2c409 BUG: 1235582 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/11436 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* features/bitrot: Fix rescheduling scrub-frequencyKotresh HR2015-08-121-20/+11
| | | | | | | | | | | | | | | | | While rescheduling scrub frequency, boot time of the brick was considered where it is not required and also delta is calculated using unsigned int resulting in the loss of fractional part leading to wrong scrub frequency. Boot time is completely removed and delta calculation is simplified. Change-Id: If54697389f663afc86408dc8a01a3ea07e00f2dc BUG: 1251042 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/11853 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com>
* features/shard: Fill inode ctx in readdir(p) callback tooKrutika Dhananjay2015-08-121-26/+45
| | | | | | | | | | | | | | | | | | | | The only place where shard translator was initialising inode ctx was lookup callback. But if the inodes are created and linked through readdirp, shard_lookup() path _may_ not be exercised before FUSE winds other fops on them. Since shard translator does an inode_ctx_get() first thing in most fops, an uninitialised ctx could cause it to fail the operation with ENOMEM. The solution would be to also initialise inode ctx if it has not been done already in readdir(p) callback. Change-Id: I3e058cd2a29bc6a69a96aaac89165c3251315625 BUG: 1250855 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/11854 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* features/changelog: Porting log messages to new logging frameworkAnusha Rao2015-08-1117-376/+1324
| | | | | | | | | | | Change-Id: Ic7f842acca52908fd88e0796dc90b82650405b25 BUG: 1194640 Signed-off-by: Anusha Rao <anusha91rao@gmail.com> Reviewed-on: http://review.gluster.org/10532 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Reviewed-by: Kotresh HR <khiremat@redhat.com>
* features/bit-rot-stub: fail the fop if inode context get failsRaghavendra Bhat2015-08-112-23/+96
| | | | | | | | | | | | | | | In stub, for fops like readv, writev etc, if the the object is bad, then the fop is denied. But for checking if the object is bad inode context should be checked. Now, if the inode context is not there, then the fop is allowed to continue. This patch fixes it and the fop is unwound with an error, if the inode context is not found. Change-Id: I5ea4d4fc1a91387f7f9d13ca8cb43c88429f02b0 BUG: 1243391 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/11449 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Venky Shankar <vshankar@redhat.com>
* features/shard: Fix excessive logging in readdir(p) callbackKrutika Dhananjay2015-08-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | On enabling features.shard on a volume which already has few files, performing operations on the mount was causing excessive logging of messages of the following kind: [2015-08-05 10:57:48.743352] E [shard.c:232:shard_modify_size_and_block_count] 2-dis-shard: Failed to get trusted.glusterfs.shard.file-size for 0b2bd401-c438-4d57-8ae5-8d26105d3396 Turns out this is coming from shard_readdir_cbk() where the shard translator unconditionally looks for the xattr 'trusted.glusterfs.shard.file-size' in every entry's rsp dict and logs this error on not finding it. But files that are not sharded (i.e., the ones that were created before sharding was enabled on the volume) will not (and should not) have this xattr associated with them. So these logs are misleading and must be suppressed in readdir(p). Change-Id: I8d268b4f90a8bf744c7851f1984f5a1b6968fb6a BUG: 1250441 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/11843 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* Revert "Add DESTDIR support for pyglupy Makefile"Kaleb KEITHLEY2015-08-032-2/+2
| | | | | | | | | This reverts commit 871000e3ddb457c9cc5757cd94cfc178e3c1be29. Change-Id: I05913151d9cb4c50057e5e72859768085041bdc9 Reviewed-on: http://review.gluster.org/11821 Tested-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* Add DESTDIR support for pyglupy MakefileMichael Scherer2015-08-032-2/+2
| | | | | | | | | | | | Smoke tests run on a new slave on Fedora 22 fail because make install try to install the python package in /usr/lib/python2.7 without being root, because there is no $DESTDIR support for that part. Change-Id: Ibed17dd091a96fbdf5536ac66b8c876b33a39cd6 Signed-off-by: Michael Scherer <mscherer@redhat.com> Reviewed-on: http://review.gluster.org/11813 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* quota/marker: set log-level to debug for ESTALE/ENOENT for marker txnvmallika2015-07-311-58/+33
| | | | | | | | | | | | | | | For all marker txn, it is possible that while the txn in progress file can be removed. So log all ENOENT/ESTALE error in debug level Change-Id: I776ba3cda33fe992f9dcc7baede7206c4ce19553 BUG: 1245544 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/11736 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* features/shard: Create /.shard with 0777 permissions (for now)Krutika Dhananjay2015-07-301-1/+1
| | | | | | | | | | Change-Id: I4e5692f06a189230825f0aeb6487b103bfb66fe1 BUG: 1247108 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/11791 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* quota: fix parents caching during build ancestryvmallika2015-07-292-75/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In build ancestry, we get the list of parents for a file, these parents are cached in inode ctx. This caching is not happening because posix is not setting d_stat information in the leaf node entry This patch fixes the issue Inode-ctx is not updated with new parent when rename performed on same directory. This patch fixes the issue There is a possibility of caching stale entries, consider below example: 1) build_ancestry invoked on a file 2) rename is invoked on the same file 3) buils_ancestry prepared entries of old parent 4) rename completed and in cbk old parent is replaced with new parent in inode ctx 5) now build_ancestry cbk adds old parent to inode ctx In this patch we also remove stale entries in writev and fallocate Change-Id: Ib1854a41b47b14eb775326588352015c83d034de BUG: 1240949 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/11574 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* features/shard: Fix block size get from xdataPranith Kumar K2015-07-291-2/+3
| | | | | | | | | | | | | | Instead of using dict_get_ptr, dict_get_uint64 was used. If the first byte of the value is '\0' then size is returned as 0 because strtoull is used in data_to_uint64. This will make it seem like the file is not sharded at all. BUG: 1247108 Change-Id: Id1fc291198ac94b20ae645c04a51db78bab51993 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/11778 Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* features/shard: (Re)initialize local->call_count before winding lookupKrutika Dhananjay2015-07-281-2/+4
| | | | | | | | | | Change-Id: I616409c38b86c0acf1817b3472a1fed73db293f8 BUG: 1247108 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/11770 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* features/bit-rot-stub: handle REOPEN_WAIT on forgotten inodesRaghavendra Bhat2015-07-281-1/+43
| | | | | | | | | | Change-Id: Ia8706ec9b66d78c4e33e7b7faf69f0d113ba68a4 BUG: 1245981 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/11729 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Venky Shankar <vshankar@redhat.com>
* features/shard: Handle unlink of files with holes appropriately in unlink() ↵Krutika Dhananjay2015-07-271-2/+30
| | | | | | | | | | | | and rename(). Change-Id: I25a02386dc95580c2e76a13fdd8e11a0df234d56 BUG: 1245547 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/11737 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
* posix,shard: Fill in ia_size and ia_blocks before unwinding (f)setattrKrutika Dhananjay2015-07-261-17/+141
| | | | | | | | | | | | | | The shard xlator will request for size xattrs in its request and posix will perform xattr_fill of requested keys before unwinding (f)setattr. Change-Id: I4ec4779568be6f805724b875b1b4215787112e7f BUG: 1246082 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/11754 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
* dict: dict_set_bin() should never free the pointer on errorNiels de Vos2015-07-243-10/+20
| | | | | | | | | | | | | | | | | | | | | | dict_set_bin() is handling the pointer that it passed inconsistently. Depending on the errors that can occur, the pointer passed to the dict can be free'd, but there is no guarantee. It is cleaner to have the caller free the pointer that allocated it and dict_set_bin() returned an error. When dict_set_bin() returned success, the given pointer will be free'd when dict_unref() calls data_destroy(). Many callers of dict_set_bin() already take care of free'ing the pointer on error. The ones that did not, are corrected with this change too. Change-Id: I39a4f7ebc0cae6d403baba99307d7ce408f25966 BUG: 1242280 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/11638 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: jiffin tony Thottan <jthottan@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
* quota/marker: contribution with list_del can cause mem corruptionvmallika2015-07-192-9/+9
| | | | | | | | | | | | | | | | There is a possibility that contribution is removed twice from list during unlink operation (with hard links) or during rename operation Use list_del_init for a thread safe deltion of member from list Change-Id: Iff5e0c03cc8f0ed85da0db1739b84b695abf9ea6 BUG: 1244109 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/11706 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* features/marker: Fixing dereference after null checkarao2015-07-171-1/+1
| | | | | | | | | | | | | | CID: 1124494 The variable was sent as a parameter to the function without the null check, hence added a check on null and error log accordingly. Change-Id: I11a649fc9a1bedad17422aeddb8dd8fa225d404e BUG: 789278 Signed-off-by: arao <arao@redhat.com> Reviewed-on: http://review.gluster.org/9641 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* features/shard: Use xattrop (as opposed to setxattr) for updates to size xattrKrutika Dhananjay2015-07-153-20/+49
| | | | | | | | | | Change-Id: Icd8984976812bb47ae7129426f6c1aa9393b3ab9 BUG: 1232391 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/11467 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* features/changelog: fix buffer overrun in changelog-helpersPrasanna Kumar Kalever2015-07-141-5/+3
| | | | | | | | | | | | | | | | | changelog-helpers.c:1911:17: warning: Size argument is greater than the free space in the destination buffer strncat (result, pre_dir_name, PATH_MAX); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ changelog-helpers.c:1919:17: warning: Size argument is greater than the free space in the destination buffer strncat (result, bname, PATH_MAX); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: I60ca7fe762f07cb72fe7b69f0253835becaff7b9 BUG: 1222238 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> Reviewed-on: http://review.gluster.org/10802 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Venky Shankar <vshankar@redhat.com>
* quota: Fix crash in quota enforcervmallika2015-07-142-122/+295
| | | | | | | | | | | | | | | | With multiple hardlinks check_quota_limit is invoked for each parent each of this check_limit can invoke validation this can cause frame->local to get corrupted during validation. Testcase tests/bugs/quota/bug-1235182.t fails spuriously with this problem Change-Id: I53adc54b431fb5f43e67a94248102ddaf0d7978f BUG: 1238747 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/11510 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* quota/marker: fix mem-leak in markervmallika2015-07-142-49/+44
| | | | | | | | | | | | Free local in error paths Change-Id: I76f69e7d746af8eedea34354ff5a6bf50234e50e BUG: 1207735 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/11617 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* features/bitrot: throttle signerVenky Shankar2015-07-141-1/+1
| | | | | | | | | | | | | | | | | Pass -DDBR_RATE_LIMIT_SIGNER CFLAGS to enable fixed value throttling based on TBF to rate limit signer. The following messags is dumped in bitd log file that this change introduces. [ [Rate Limit Info] "tokens/sec (rate): 131072, maxlimit: 524288" ] Bug: 1242809 Change-Id: I063e41d4c7bcddd7a940cc175e89536cd4fe2804 Signed-off-by: Venky Shankar <vshankar@redhat.com> Reviewed-on: http://review.gluster.org/11641 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com>
* features/bitrot: move inode state just at the last momentVenky Shankar2015-07-131-19/+42
| | | | | | | | | | | | | | | Which was done at half the set expiry time resulting in actual IOs incrementing the object version. Now this is done just at the last moment with re-notification now cut-shorting into checksum calculation without waiting in the timer-wheel. BUG: 1242317 Change-Id: If655b77d822ebf7b2a4f65e1b5583dd3609306e7 Signed-off-by: Venky Shankar <vshankar@redhat.com> Reviewed-on: http://review.gluster.org/11461 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
* ctr:Avoid assertion failure in lookupMohammed Rafi KC2015-07-122-13/+13
| | | | | | | | | | | | | | in ctr_lookup, the loc variable need not be comes with pargfid, though there is a parent for the inode. The same for loc->name also. From this patch, we will generate loc->name from loc->path Change-Id: I24a79554748139504ec09f77930f8208d3805977 BUG: 1236128 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/11459 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Joseph Fernandes