From b0ed286e9b53c5ad24f04686cd6ddfad940b87f3 Mon Sep 17 00:00:00 2001 From: vmallika Date: Mon, 29 Sep 2014 13:02:30 +0530 Subject: glusterd/quota: Heal pgfid xattr on existing data when the quota is enable Backport of: http://review.gluster.org/8878 The pgfid extended attributes are used to construct the ancestry path (from the file to the volume root) for nameless lookups on files. As NFS relies on nameless lookups heavily, quota enforcement through NFS would be inconsistent if quota were to be enabled on a volume with existing data. Solution is to heal the pgfid extended attributes as a part of lookup perfomed by quota-crawl process. In a posix lookup check for pgfid xattr and if it is missing set the xattr. Change-Id: I956128907aa1d975cd5719ed3ab2f4f9b37d4c31 BUG: 1153900 Signed-off-by: vmallika Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/8938 Tested-by: Gluster Build System Reviewed-by: Niels de Vos --- tests/basic/quota-anon-fd-nfs.t | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 tests/basic/quota-anon-fd-nfs.t (limited to 'tests') diff --git a/tests/basic/quota-anon-fd-nfs.t b/tests/basic/quota-anon-fd-nfs.t new file mode 100755 index 00000000000..c0af918beb4 --- /dev/null +++ b/tests/basic/quota-anon-fd-nfs.t @@ -0,0 +1,34 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc + +cleanup; + +TEST glusterd +TEST pidof glusterd +TEST $CLI volume info; + +TEST $CLI volume create $V0 $H0:$B0/brick1; +EXPECT 'Created' volinfo_field $V0 'Status'; + +TEST $CLI volume set $V0 network.inode-lru-limit 1 + +TEST $CLI volume start $V0; +EXPECT 'Started' volinfo_field $V0 'Status'; + +TEST mount -t nfs localhost:/$V0 $N0 +sleep 10 +deep=/0/1/2/3/4/5/6/7/8/9 +TEST mkdir -p $N0/$deep + +TEST dd if=/dev/zero of=$N0/$deep/file bs=1K count=1M + +TEST $CLI volume quota $V0 enable +TEST $CLI volume quota $V0 limit-usage / 2GB +TEST $CLI volume quota $V0 soft-timeout 0 + +sleep 10 +TEST dd if=/dev/zero of=$N0/$deep/newfile_1 bs=500 count=1M +TEST ! dd if=/dev/zero of=$N0/$deep/newfile_2 bs=1000 count=1M + +cleanup; -- cgit