Description of problem: When quota is configured on directory, deleting that directory from mount point, quota list doesn't list any output. Version-Release number of selected component (if applicable): glusterfs-server-3.8.4-13.el7rhgs.x86_64 How reproducible: 100% Steps to Reproduce: 1. Create distribute-replicate volume 2. Do fuse mount and create some file and directories 3. enable quota and set limit-usage on directories 4. Delete directory from mount on which quota was configure 5. Run quota list command Actual results: quota list command output is blank ================================= [root@dhcp46-88 yum.repos.d]# gluster v quota vol0 list [root@dhcp46-88 yum.repos.d]# Expected results: quota list command should data usage Additional info:
The issue is hit only if the last gfid in quota.conf happens to be stale (due to rmdir). The code to print the list is nested under rsp.dict.dict_len check in cli_quotad_getlimit_cbk. If the last gfid happened to be stale the dict_len would be zero an we would not reach the print code. We need to move the print stmt. outside the check to solve this issue. if (rsp.dict.dict_len) { dict = dict_new (); ret = dict_unserialize (rsp.dict.dict_val, rsp.dict.dict_len, &dict); ... ret = dict_get_int32 (local->dict, "max_count", &max_count); ... node = list_node_add_order (dict, &local->dict_list, cli_quota_compare_path); ... if (list_count == max_count) { list_for_each_entry_safe (node, tmpnode, &local->dict_list, list) { dict = node->ptr; print_quota_list_from_quotad (frame, dict); list_node_del (node); dict_unref (dict); } } }
upstream patch : https://review.gluster.org/#/c/16507/
downstream patch : https://code.engineering.redhat.com/gerrit/#/c/101307
[root@rhs-arch-srv1 yum.repos.d]# gluster v quota vol1 list Path Hard-limit Soft-limit Used Available Soft-limit exceeded? Hard-limit exceeded? ------------------------------------------------------------------------------------------------------------------------------- / 2.0GB 80%(1.6GB) 1.8GB 190.0MB Yes No /test 1.0GB 80%(819.2MB) 1.0GB 0Bytes Yes Yes Operations on Client: [root@dhcp47-13 fuse]# ll total 838149 drwxr-xr-x. 2 root root 4096 May 2 14:25 test -rw-r--r--. 1 root root 858259484 May 2 13:59 testfile [root@dhcp47-13 fuse]# rm -rf test [root@rhs-arch-srv1 yum.repos.d]# gluster v quota vol1 list Path Hard-limit Soft-limit Used Available Soft-limit exceeded? Hard-limit exceeded? ------------------------------------------------------------------------------------------------------------------------------- / 2.0GB 80%(1.6GB) 818.5MB 1.2GB No No bug verified on build glusterfs-3.8.4-24.el7rhgs.x86_64
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:2774
*** Bug 1575154 has been marked as a duplicate of this bug. ***