summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge "tests: add test to verify anonymous fd handling in quota" into ↵Vijay Bellur2013-09-011-0/+46
|\ \ \ | |/ / |/| | | | | upstream_on_quota
| * | tests: add test to verify anonymous fd handling in quotaKrishnan Parthasarathi2013-08-201-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | TODO: * Need to foreground the "dd" after volume-start command Change-Id: I4ff09f80bf63d88c0449f7b965cd61815542919e Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
* | | Merge "glusterd: Implement persistent store for quota" into upstream_on_quotaVijay Bellur2013-08-278-24/+550
|\ \ \
| * | | glusterd: Implement persistent store for quotaKrutika Dhananjay2013-08-258-24/+550
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting quota limits on a given directory will cause glusterd to persist the gfid of the path in WD/vols/<volname>/quota.conf. Also, executing 'quota remove' will cause glusterd to remove the gfid of the given path. This is needed for implementing the 'list-all' variant of 'quota list' command. To-Do: 1. Exchange quota.conf when a new node is added into the cluster; 2. Unlink quota.conf on disabling quota (?) Change-Id: I7d75a9cdb43e4e1389ddb08ffe09b294d36f87d8 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
* | | posix/marker-quota/marker-enforcer: introduce and use GET_ANCESTRY_DENTRY_KEYRaghavendra G2013-08-268-118/+374
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A getxattr on key GET_ANCESTRY_DENTRY_KEY to storage/posix would return a list of direntries which can be used to construct inode contexts of individual translators. The result of getxattr on this key can be viewed as similar to readdirp_cbk with the difference that the dentries returned here represent various paths from that inode till root rather than the children of a directory. This patch also modifies marker/quota and enforcer to utilize this key. Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Change-Id: I7132e7d56f2fac0f8749f51227d9f2ef27f9d354 BUG: 969461
* | | features/quota: fix compiler warnings.Raghavendra G2013-08-261-15/+15
| | | | | | | | | | | | | | | | | | Change-Id: I960cf42c3cacecb9d1cdb258e063b8691a16ca20 BUG: 969461 Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
* | | features/quota-enforcer: ask posix to construct dentry chain till root when ↵Raghavendra G2013-08-261-66/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a parent cannot be found for an inode. Quota enforcement requires checking of limits on all ancestors till root. With anonymous fds and nameless lookups, all the ancestors may not be populated in inode table. A getxattr on key GET_PATH_KEY would make storage/posix to construct the dentry chain till root. Change-Id: I1e2172c28a9c7eb918fe41b63b30209733df148c BUG: 969461 Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
* | | posix: placeholders for GFID to path conversionRaghavendra G2013-08-264-107/+803
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following is an attempt to generate the paths of a file when only its gfid is known. To find the path of a directory, the symlink handle to the directory maintained in the ".glusterfs" backend directory is read. The symlink handle is generated using the gfid of the directory. It (handle) contains the directory's name and parent gfid, which are used to recursively construct the absolute path as seen by the user from the mount point. A similar approach cannot be used for a regular file or a symbolic link since its hardlink handle, generated using its gfid, doesn't contain its parent gfid and basename. So xattrs are set to store the parent gfids and the number of hardlinks to a file or a symlink having the same parent gfid. When an user/application requests for the paths of a regular file or a symlink with multiple hardlinks, using the parent gfids stored in the xattrs, the paths of the parent directories are generated as mentioned earlier. The base names of the hardlinks (with the same parent gfid) are determined by matching the actual backend inode numbers of each entry in the parent directory with that of the hardlink handle. Xattr is set on a regular file, link, and symbolic link as follows, Xattr name : trusted.pgfid.<pargfidstr> Xattr value : <number of hardlinks to a regular file/symlink with the same parentgfid> If a regular file, hard link, symbolic link is created then an xattr in the above format is set in the backend. The path of a file can be found by getting the value of the virtual xattr named "glusterfs.getpath". The multiple hardlinks of a file or a symlink are displayed as a colon seperated list (this could interfere with path components containing ':'.) e.g. In Gluster file system, a filename "file1" in the root directory with hardlinks "/dir2/link2tofile1" and "/dir1/link1tofile1" are created. [root@alpha gfsmntpt]# getfattr -n glusterfs.getpath -e text file1 glusterfs.getpath="/file1:/dir2/link2tofile1:/dir1/link1tofile1" Thanks Amar, Avati and Venky for the inputs. Change-Id: I2304a50db9b0f73fbea2ca01b61c8a598d464da6 BUG: 990028 Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Original Author: Ramana Raja <rraja@redhat.com>
* / features/quota: remove the entry from the context for internal unlinks alsoRaghavendra Bhat2013-08-201-7/+5
|/ | | | | | | | | | | | | | | | distribute xlator does the below operations as internal fops for rename FOP: rename a -> b link b unlink a distribute sends the above link and unlink fops as internal fops. Quota xlator upon seeing link and unlink as internal fops does not add/remove the entries to/from the inode context. So when unlink comes, even though the fop is internal fop, go through the list of names in the context and if the name of the entry being unlinked is found in the list, then remove it from the list. Change-Id: I9a57e3b9c295f7fce6a9e952a24b59897e856e98 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
* Merge "features/quota: Fix a memory leak in quota_lookup()" into ↵Vijay Bellur2013-08-191-3/+8
|\ | | | | | | upstream_on_quota
| * features/quota: Fix a memory leak in quota_lookup()Vijay Bellur2013-08-191-3/+8
| | | | | | | | | | Change-Id: I1cb7eb190f52f6eba015c6fc25621ee7a5a05c26 Signed-off-by: Vijay Bellur <vbellur@redhat.com>
* | Merge "mgmt/glusterd: Correct auto variable initialization." into ↵Vijay Bellur2013-08-192-7/+18
|\ \ | |/ |/| | | upstream_on_quota
| * mgmt/glusterd: Correct auto variable initialization.Vijay Bellur2013-08-192-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously struct foo { int a; int b; } bar1, bar2 = {0,}; inited only members of bar2 to 0. This has been set right. Also added verification tests for soft-quota configuration. Change-Id: I9e3b4d65286e59d7dad8db8fa649b1b91a5d25bc Signed-off-by: Vijay Bellur <vbellur@redhat.com>
* | features/marker: Avoid additional stat for an internal unlinkVijay Bellur2013-08-171-1/+3
|/ | | | | Change-Id: I50d2eff0b3114f5ac91164815b308a441cd8800e Signed-off-by: Vijay Bellur <vbellur@redhat.com>
* Merge "tests: Add rename accounting tests to quota.t" into upstream_on_quotaVijay Bellur2013-08-171-2/+11
|\
| * tests: Add rename accounting tests to quota.tVijay Bellur2013-08-151-2/+11
| | | | | | | | | | Change-Id: I366328aab53e960004f988befd2bcc1d2aa4c48d Signed-off-by: Vijay Bellur <vbellur@redhat.com>
* | Merge "features/quota: rename friendly changes" into upstream_on_quotaVijay Bellur2013-08-172-0/+18
|\|
| * features/quota: rename friendly changesVijay Bellur2013-08-152-0/+18
| | | | | | | | | | Change-Id: I510a3f068ab141a707fd6535d51d4b3fa37930f0 Signed-off-by: Vijay Bellur <vbellur@redhat.com>
* | Merge "features/marker: Rename friendly changes" into upstream_on_quotaVijay Bellur2013-08-173-7/+23
|\|
| * features/marker: Rename friendly changesVijay Bellur2013-08-153-7/+23
| | | | | | | | | | | | | | | | Also contains parts of http://review.gluster.org/5389 which have not yet been pulled in. Change-Id: I9fca5f2082b86da357478e6adde52c5a0abacd39 Signed-off-by: Vijay Bellur <vbellur@redhat.com>
* | Merge "mgmt/glusterd: Initialize auto variables" into upstream_on_quotaVijay Bellur2013-08-151-1/+1
|\ \
| * | mgmt/glusterd: Initialize auto variablesVijay Bellur2013-08-151-1/+1
| |/ | | | | | | | | Change-Id: I72e97bf57bd4103506324b5caf8dffb3fd7d7f71 Signed-off-by: Vijay Bellur <vbellur@redhat.com>
* / quota: log usage only when soft-quota-limit is crossedKrishnan Parthasarathi2013-08-152-41/+45
|/ | | | | | | | Also handled reconfigure event for quota options such as soft-timeout, hard-timeout and alert-time Change-Id: I5dfdb76901d4f3af824b30838318268e5edcee34 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
* features/quota: Resume fops for internal clients.Vijay Bellur2013-08-131-1/+7
| | | | | Change-Id: If1773603bcc5b393796e96439929e7fd2867127a Signed-off-by: Vijay Bellur <vbellur@redhat.com>
* quota: fix ESTALE in lookupKrishnan Parthasarathi2013-08-122-2/+15
| | | | | | Original-author: Raghavendra Gowdappa <rgowdapp@redhat.com> Change-Id: I245f1914a38332b8e5e7f1581c9437cf5a9ab6f0 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
* Change branch to upstream_on_quotaKrutika Dhananjay2013-08-121-1/+1
| | | | | Change-Id: I0e3946ef1cec20bf3a475e7ade038520eed0926b Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
* glusterd,cli: Use 'packed' attribute while reading/writing xattrs from/to ↵Krutika Dhananjay2013-08-122-4/+10
| | | | | | | backend Change-Id: I9229899361794d48bb2f741fb989bf025081987f Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
* glusterd: Remove aux mounts on every node in cluster during 'quota disable'Krutika Dhananjay2013-08-122-1/+49
| | | | | | | | With this patch, upon disablement of quota on a given volume, the auxiliary mounts if present are removed on every node by glusterd during commit op. Change-Id: Ie50fda8da28635f3f65a25106e2277b4a2fc45f9 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
* cli: Perform mount from CLI on demandKrutika Dhananjay2013-08-123-68/+105
| | | | | | | | | | | | | | | | The CLI now performs a mount everytime any one of the following quota commands are issued: a. enable b. limit-usage c. list d. remove The pidfile of the auxiliary mount process will be placed under DEFAULT_VAR_RUN_DIRECTORY and will be named <volname>.pid Change-Id: I09709ea5c0c59871c33544dee7e691f6cd0ecef3 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
* glusterd: Treat default value of default-soft-limit as 80% in 'quota list'Krutika Dhananjay2013-08-121-1/+1
| | | | | Change-Id: I3ce0bb417b6faa9430689039741d0477cb7a582f Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
* tests/basic: Improve quota.t to include enforcement testsorigin/upstream_on_quotaVijay Bellur2013-08-121-6/+38
| | | | | | Change-Id: I7fce33e7d1c075b9610df7f6e9db1cc862630170 BUG: 969461 Signed-off-by: Vijay Bellur <vbellur@redhat.com>
* common-utils: Move glusterd_is_service_running() to common-utilsKrutika Dhananjay2013-08-126-46/+43
| | | | | Change-Id: I96cbe03511cbecb112418da82c44c00fbab74ba3 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
* features/marker: Fix an incorrect NULL checkVijay Bellur2013-08-121-3/+4
| | | | | | Change-Id: If9bb12b352af5a691bd17fc51f0273685ecb12e8 BUG: 969461 Signed-off-by: Vijay Bellur <vbellur@redhat.com>
* features/marker: reduce severity of an annoying log.Vijay Bellur2013-08-121-2/+2
| | | | | Change-Id: If65129812b10afc19a22b2b0c468b53043bde1db BUG: 969461
* features/marker: refactor marker quota for better readability (part 1).Vijay Bellur2013-08-122-23/+38
| | | | | Change-Id: I1133c5ca24f2b395103d470bde77be966d17d938 Signed-off-by: Vijay Bellur <vbellur@redhat.com>
* features/quota: Add support for statedumpVijay Bellur2013-08-122-0/+41
| | | | | | | | - dumps members of quota_priv_t. - also added validation count to keep track of number of validations done. Change-Id: I998fcccacf4bd7c61ead9ca9a489e0dc0e73763a Signed-off-by: Vijay Bellur <vbellur@redhat.com>
* quota: saner defaults, min and max values for timeoutsKrishnan Parthasarathi2013-08-121-4/+4
| | | | | | | | Also changed default soft-limit percentage to 80% of configured quota limit. Change-Id: Ia07b569216189a6e3bedb5cdbf8ffeb9f7739444 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
* glusterd, quotad: volume-id option fixupsBrian Foster2013-08-122-2/+21
| | | | | | | | | | | A few little hacks to set the volume id on the quota server and a mapping option on quotad to map the volume name to the uuid passed via the lookup request. Change-Id: Ic151acb18ed29d2ee4ae5d1bc6841ae4a4de176a Original-author: Brian Foster <bfoster@redhat.com> Signed-off-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
* features/quota: Fix compilation warningsKrutika Dhananjay2013-08-122-5/+4
| | | | | | | | | | | | | | | | | | The following are the compilation warnings I encountered: ----------------------------------- In file included from quota.c:12:0: quota.h:190:1: error: 'packed' attribute ignored [-Werror=attributes] quota.c: In function 'quota_lookup_cbk': quota.c:618:23: error: assignment from incompatible pointer type [-Werror] quota.c:637:53: error: 'soft_lim' undeclared (first use in this function) quota.c:637:53: note: each undeclared identifier is reported only once for each function it appears in quota.c:608:28: error: unused variable 'size' [-Werror=unused-variable] cc1: all warnings being treated as errors ----------------------------------- Change-Id: I7a09e654a9cc064a423a5f8362f2a9c6abbc7edb Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
* features/quota: minor fixes to enforcerRaghavendra G2013-08-122-12/+5
| | | | | | | | | | * send size query to quotad only if limit is set on that inode. * don't check for loc->parent while querying size from quotad, since its a nameless lookup Change-Id: I10dc2f9d1e40875382040b53cb4ee5f6d9a27133 BUG: 969461 Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
* features/quota: fixes to code reading limits from xattrs.Raghavendra G2013-08-123-46/+34
| | | | | | | | | | It was assumed that hard and soft limits are stored as two different xattrs on disk. However they are stored as two members of a structure which is stored as a value for a single key. Change-Id: I947fa5c375209c31fe1511bda0d5cb0e249af9ba BUG: 969461 Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
* glusterd,cli: changes to quota list <path> ...Krutika Dhananjay2013-08-122-321/+82
| | | | | Change-Id: Ia37020c3aa11af6eed3af09cfe390b848b028b6a Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
* glusterd: Clean up and fix glusterd_op_quota()Krutika Dhananjay2013-08-124-130/+85
| | | | | | | | | | | | | | | | | | | | ... and also fix cli logging In glusterd_op_quota(), * do not modify ret after going to 'out' as this causes the failure status (-1) to be overwritten, thereby causing the command to return 0 even on failure. * knock off additional labels like create_vol. * replace 'if' statements with 'switch case' statement. * delete only the 3 timeouts and the defaul-soft-limit, if present, from volinfo->dict, upon disablement of quota. Change-Id: If486a5373b66f2379d6d041a974d9b824fcb8518 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
* glusterd: Changes to 'quota remove' subcommand behaviorKrutika Dhananjay2013-08-121-44/+39
| | | | | Change-Id: Ifdc60071146587dc5c60d9a53a92d49b3487fd82 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
* glusterd: club limit-usage and soft-limit into a single commandKrutika Dhananjay2013-08-126-221/+183
| | | | | Change-Id: I5f680675576aeec584b497eb25dd804a9dd6d690 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
* quota: Fix initialisation of privKrutika Dhananjay2013-08-121-0/+2
| | | | | | | Original-author: Vijay Bellur <vbellur@redhat.com> Change-Id: Iea21ef1cdfb78c79482ad02f81734516b7818714 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
* Change branch to quota.Vijay Bellur2013-08-121-1/+1
| | | | Change-Id: I8a6d49cc101da219404633d43b8d211f816094a7
* features/quota: Allow the gluster 'special' processes to supercede the limitsVijay Bellur2013-08-121-4/+18
| | | | | | | | | Don't block the gluster internal processes like rebalance, gsyncd, self heal etc from the disk quotas and the xattrs setting. Solution: Allow all the clients with negative PID. Change-Id: Iaeaa8096e00d48b2a4c3f5df61d103da0b3d6598
* features/quota: Fix compilation warningsVijay Bellur2013-08-122-8/+24
| | | | Change-Id: Ie0b3af8b52f2d909c61094bdcaccfd724ff4ecc0
* features/quota: Introduce quota log helper function.Vijay Bellur2013-08-122-0/+55
| | | | Change-Id: I38077c7adc497b314f4037cbbb116458a26ed589