summaryrefslogtreecommitdiffstats
path: root/xlators/features/marker/src/marker.c
Commit message (Collapse)AuthorAgeFilesLines
* features/marker: Replacing -1 with GF_CLIENT_PID_GSYNCD as part of code cleanup.release-3.2Mohammed Junaid2013-02-071-3/+3
| | | | | | | | | | | To Keep the code(rel-3.2) consistent with the master(rel-3.3) branch. Change-Id: I6a052a35abf022d5551ec9b59db0ae19f81f326d BUG: 769494 Signed-off-by: Mohammed Junaid <junaid@redhat.com> Reviewed-on: http://review.gluster.org/2969 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Csaba Henk <csaba@redhat.com>
* features/marker: xtime should not be updated for modifications done by ↵Junaid2012-01-241-1/+7
| | | | | | | | | | | special client. Change-Id: I4b34d449b3ab08e2189fe1ff088299617b640206 BUG: 769494 Signed-off-by: Junaid <junaid@redhat.com> Reviewed-on: http://review.gluster.com/2564 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Csaba Henk <csaba@redhat.com>
* features/marker-quota: Use stack_wind_cookie in place of stack_wind to ↵v3.2.5qa9v3.2.5Junaid2011-11-111-11/+12
| | | | | | | | | | | | | preserve the cookie value. In marker_rename, some of the call back functions make use of cookies sent by the calling functions. In case of stack_wind the frame->cookie is over written with the address of new frame. Change-Id: I8ec98f3305700e2c3295a10dff159ca6a19a380a BUG: 3808 Reviewed-on: http://review.gluster.com/717 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* check the return value of inode_path for less than or equal to zeroRaghavendra Bhat2011-10-281-1/+1
| | | | | | | | Change-Id: I9bbdfe79664c1339b66819a6c7ea4b7698beb5c6 BUG: 3757 Reviewed-on: http://review.gluster.com/640 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com>
* features/marker: Use appropriate loc struct to do removexattr on newpath ↵Raghavendra G2011-09-201-1/+13
| | | | | | | | | | after rename. Change-Id: Idb31e845bc876f46b476d8fa769d67d8db89e4a1 BUG: 3493 Reviewed-on: http://review.gluster.com/389 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* features/quota: explicitly create xattrs in marker_create_cbkRaghavendra G2011-09-191-3/+3
| | | | | | | | | | | | | | - the earlier approach of creating quota related xattrs through side-effect of updating size and contribution values won't work, since when no contribution xattr is present, the updation process treats contribution value as zero and hence will be equal to size of freshly created files Change-Id: If9b2063b1ac3a4cf50d3fe2c81e907bc8eccb677 BUG: 3531 Reviewed-on: http://review.gluster.com/383 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Mohammed Junaid <junaid@gluster.com>
* features/marker-quota: Perform xattr related operations with root ↵Junaid2011-09-121-5/+24
| | | | | | | | | | permissions in rename fop. Change-Id: Id9ac1ecdd9753377c9eb24464f51dcbdc0cd2821 BUG: 3194 Reviewed-on: http://review.gluster.com/366 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* features/marker-quota: Prefix the function names with mq (marker-quota).Junaid2011-09-121-18/+18
| | | | | | | | | | This is to fix to bug marker translator and quota translator cannot co-exist in same process. Change-Id: Ie0419e1a66d300e163d27b21441ad8d8139b6097 BUG: 30203020 Reviewed-on: http://review.gluster.com/393 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* memleak fixes for markerRaghavendra Bhat2011-09-111-3/+5
| | | | | | | | | Change-Id: I33623f874fbf3a3c491322877ed54e99d3cfc623 BUG: 2784 Reviewed-on: http://review.gluster.com/298 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* features/marker: send the errno sent by posix to the upper xlators, instead ↵Raghavendra Bhat2011-08-201-1/+2
| | | | | | | | | | | | | | | | | of ENOMEM Marker sends stat first, before sending the unlink. By the time stat reaches posix if the file is deleted by another client, then stat fails with op_errno set to ENOENT. But in the corresponding call back function of marker (i.e marker_unlink_stat_cbk), we check for (op_ret < 0) and if so we unwind by sending ENOMEM as the error to the above xlators which results in the applications (such as rm -rf) also getting ENOMEM. Change-Id: Idb63215a6c46f3acfe4c0fa7cb2dd97b0170441b BUG: 3429 Reviewed-on: http://review.gluster.com/253 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* Change Copyright current yearPranith Kumar K2011-08-101-1/+1
| | | | | | | | Change-Id: Id1f1a91cf15d933d5621a0073ddaebe02df0f159 BUG: 3348 Reviewed-on: http://review.gluster.com/198 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
* features/marker-quota: Perform removexattr with frame uid and gid set to root.Junaid2011-07-291-0/+10
| | | | | | | | Change-Id: Iabd8ff835c76d828e4af50ce4941d2ff86797eee BUG: 3194 Reviewed-on: http://review.gluster.com/99 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <raghavendra@gluster.com>
* features/marker-quota: Fix some random memory leaks.Junaid2011-07-281-1/+3
| | | | | | | | | Change-Id: I1b01adf1d0ecf494f960d125f2bdcc9c10137115 BUG: 3169 Reviewed-on: http://review.gluster.com/73 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: Raghavendra G <raghavendra@gluster.com> Reviewed-by: Raghavendra G <raghavendra@gluster.com>
* features/marker: fix race-conditions, memory corruptions and fd-leaks.Raghavendra G2011-07-201-132/+511
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - remove xattrs from newpath after rename is complete. - hold inodelk on both parents (if they are different) before doing rename and gather contribution values of oldpath and newpath to their parents while still holding the locks. Use these contribution values to reduce parent sizes. - performance optimization: abort updation process if delta is zero. - libglusterfs/call-stub: Allow unwinding of frames for rename during call_resume_unwind. - fixes in dirty inode healing codepath: - fix fd-leak of fd opened on the directory. - don't add (instead just assign) next offset at which readdir has to be sent to local->d_off. - assign to local->d_off before winding lookup call to get child contribution. - use mutexes while accessing contribution values stored in inode context. - use contribution values from backend instead of in-memory while reducing parent sizes during rename - wipe parent_loc in marker_local_unref. - check for refcount being zero holding lock in quota_local_unref. - hold parent inodelk during creation of xattrs on directory. - use contribution value to reduce parent's size, if the value to be subtracted is not passed as argument to reduce_parent_size. - skip contribution creation on root. Change-Id: I97a9ac7efc5cf82abd3837fa6f9766c35676a908 BUG: 2697 Signed-off-by: Junaid <junaid@gluster.com> Reviewed-on: http://review.gluster.com/31 Tested-by: Gluster Build System <jenkins@build.gluster.com>
* marker: fill out the volume-mark properly in case of marking corruptionCsaba Henk2011-05-311-1/+1
| | | | | | | | | | | Signed-off-by: Csaba Henk <csaba@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2858 (volume-mark corruption swallowed) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2858 BUG: 2858 (volume-mark corruption swallowed) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2858
* marker: fix NULL deref in loggingv3.2.0Anand Avati2011-04-291-2/+3
| | | | | | | | | Fix bad gf_log argument Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2852 (Glusterfsd crashes on AMI) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2852
* features/marker-quota: handle creation of regular files using mknod.Raghavendra G2011-04-211-0/+6
| | | | | | | | | | - Add the disk-used to parents' size. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2649 (Quota: size field is not getting updated properly) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2649
* features/marker-quota: handle overflow of counter used to set ↵Raghavendra G2011-04-211-0/+4
| | | | | | | | | | frame->root->lk_owner. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2804 (Occasional log messages seen indicating failure of inodelk) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2804
* features/marker-quota: Add the disk space used to parent sizes during ↵Raghavendra G2011-04-211-2/+2
| | | | | | | | | | creation of new-files or symlinks. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2649 (Quota: size field is not getting updated properly) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2649
* features/marker: reduce the size corresponding to destination file if it is ↵Raghavendra G2011-04-211-2/+15
| | | | | | | | | | already present from parent directories. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2697 (Quota: add-brick creates the size go awkward, though it was perfect earlier) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2697
* marker: fixes to bypass marker fops in case features are enabledAmar Tumballi2011-04-191-9/+22
| | | | | | | | | | mainly in unlink and rename Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2801 (glusterfsd process crash while running rebalance on simple volume) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2801
* features/marker-quota: reduce contributions to parents during unlink only if ↵Raghavendra G2011-04-181-3/+32
| | | | | | | | | | | | | | | | | | | it is the last link. - since we are not having different contributions for different (parent, name) pairs, but only for different parents, links present in the same directory will have only one contribution representing all of them. Hence parents will not be updated for each link call and parents account for just file-size instead of (numlinks * filesize). However this patch will cause issues for links present accross directories, as only one of their contributions is subtracted when all of them removed (Here all the links are accounted in their parents, thereby total size accounted is [numlinks * filesize]). Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2689 (Quota: xattrs getting corrupted) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2689
* features/marker-quota: remove contribution xattrs from oldloc in rename.Raghavendra G2011-04-181-6/+43
| | | | | | | | | | | | | | - Though we are setting in memory contribution to zero, during updation process contribution is actually fetched from backend. If they are not deleted and if newpath did not exist before doing rename, contributions from oldloc->inode will be retained even for newloc->inode, there by preventing addition of file-size to parents in newpath. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2689 (Quota: xattrs getting corrupted) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2689
* use "geo-replication" all over as the official name of this featureCsaba Henk2011-04-151-48/+48
| | | | | | | | | | Use GEOREP macro if you want to refer to the feature in code. Signed-off-by: Csaba Henk <csaba@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2757 (refactory gsync/gsyncd/syncdaemon/whatever to geo-replication) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2757
* features/marker: fix the excessive logs in markerAmar Tumballi2011-04-141-6/+8
| | | | | | | | Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2754 ([glusterfs-3.2.0qa11]: excessive logging in marker) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2754
* marker: pass cookie properly while filtering quota xattrs.v3.2.0qa12Raghavendra G2011-04-141-6/+9
| | | | | | | | Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2473 (Support for volume and directory level quota) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2473
* features/marker: Filter the quota xattr's on getxattr with NULL name argument.Junaid2011-04-131-1/+17
| | | | | | | | Signed-off-by: Junaid <junaid@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2473 (Support for volume and directory level quota) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2473
* marker: check the return value being less than zero instead of -1Raghavendra Bhat2011-04-111-1/+3
| | | | | | | | Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2711 ([glusterfs-3.2.0qa10]: glusterfs server crashed in marker_setxattr operations) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2711
* features/marker: Synchronise the read and write of marker_local_ref.Junaid2011-04-081-2/+4
| | | | | | | | Signed-off-by: Junaid <junaid@gluster.com> Signed-off-by: Vijay Bellur <vijay@gluster.com> BUG: 2663 (glusterfsd crash with bonnie++ when marker is enabled) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2663
* features/marker: Check if gsync is enabled in getxattr fop before performing ↵Junaid2011-04-071-2/+8
| | | | | | | | | | gsync related operations. Signed-off-by: Junaid <junaid@gluster.com> Signed-off-by: Vijay Bellur <vijay@gluster.com> BUG: 2681 (marker returns dummy data for volume-mark attribute if xtime is switched off) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2681
* features/marker: Fix memory corruption.Junaid2011-03-311-2/+8
| | | | | | | | Signed-off-by: Junaid <junaid@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2629 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2629
* features/marker: check for op_ret before doing any operations in lookup callbackMohammed Junaid Ahmed2011-03-291-10/+3
| | | | | | | | Signed-off-by: Junaid <junaid@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2497 (client crashes) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2497
* check the local for NULL before accessing itv3.2.0qa5Raghavendra Bhat2011-03-271-3/+3
| | | | | | | | Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2592 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2592
* features/marker: Handle fop's gracefully when none of the feaures are enabled.Junaid2011-03-261-109/+228
| | | | | | | | Signed-off-by: Junaid <junaid@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2529 (Starting Gsync causes ENOTCONN to glusterfs client) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2529
* features/marker: Donot fail init when both gsync and quota are not enabled.Mohammed Junaid Ahmed2011-03-221-35/+76
| | | | | | | | Signed-off-by: Junaid <junaid@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2529 (Starting Gsync causes ENOTCONN to glusterfs client) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2529
* features/marker: Invalid option "marker", use "gsync" instead.Mohammed Junaid Ahmed2011-03-161-2/+9
| | | | | | | | Signed-off-by: Junaid <junaid@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2473 (Support for volume and directory level quota) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2473
* features/marker: QUOTA related changes in marker translator.Mohammed Junaid Ahmed2011-03-161-89/+428
| | | | | | | | Signed-off-by: Junaid <junaid@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2473 (Support for volume and directory level quota) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2473
* features/marker: open the timestamp file with O_TRUNC to update the ctimeKaushik BV2011-03-141-6/+3
| | | | | | | | Signed-off-by: Kaushik BV <kaushikbv@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2354 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2354
* Revert "features/marker: Use touch TimeStamp file instead of futimens, to ↵Kaushik BV2011-03-141-14/+19
| | | | | | | | | | | | avoid the dependency of newer libc" This reverts commit e045741f2bb75344a557cd618e1c7b1691238703. Signed-off-by: Kaushik BV <kaushikbv@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2354 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2354
* features/marker: Use touch TimeStamp file instead of futimens, to avoid the ↵Kaushik BV2011-02-101-19/+14
| | | | | | | | | | dependency of newer libc Signed-off-by: Kaushik BV <kaushikbv@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2354 (handling futimens with older glibc) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2354
* marker: Updating the xtime marks on both the paths in rename fop.Mohammed Junaid Ahmed2011-02-041-3/+25
| | | | | | | | Signed-off-by: Junaid <junaid@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2372 (marker: time stamp not updated with rename) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2372
* adding marker translatorJunaid2011-01-271-0/+1420
Signed-off-by: Junaid <junaid@gluster.com> Signed-off-by: Csaba Henk <csaba@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2310 (georeplication) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2310