From patchwork Tue May 22 07:33:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artem Blagodarenko X-Patchwork-Id: 918049 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ext4-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KHR24f5Y"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40qnTt4FdDz9s4w for ; Tue, 22 May 2018 17:34:42 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751417AbeEVHel (ORCPT ); Tue, 22 May 2018 03:34:41 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:43809 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751272AbeEVHel (ORCPT ); Tue, 22 May 2018 03:34:41 -0400 Received: by mail-lf0-f66.google.com with SMTP id n18-v6so27612695lfh.10 for ; Tue, 22 May 2018 00:34:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=lmor5hXJh1Yq6FjnZI3XwW+tDJgj76WMQPmaTBoH1zE=; b=KHR24f5Y55g1wzRd9F9tX9dJ0ciCVzwe3KK4Ad/w6omxTCewQyh/6i5vppuutJUsZp mgZZs9GzfpmuphLkOfjK1MgmcVehExOAyHKLw3HjNR2KlyshgYcZdZOZ/Pgv2cUwt2LB Ptj56iHeeZixpnXb74XWZZF6k5Lx0YYn7LJ/F6xs/C1GIAN1viKoXkYFj6TlQA1jWYhO 8DxYisI2llEoASskRHE3lNANbvKu67vJ8nVWAH1kkD8eyuGZ4SCwbtd8+1Los1UJUyk4 S1mdqdG68oal7KzNSs2f2zWssI7xJUrvl7ndvvTY339PhVlwFx+o1WIIqooBYCCUNqpP cLjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=lmor5hXJh1Yq6FjnZI3XwW+tDJgj76WMQPmaTBoH1zE=; b=QG+eeAgM0npoDBeBtmHCj/7uO2llgDyjSTYcTv2tBat+99OZmUNj9sBsJMyAykK13b M/M+HqlRBhxedKsBfi0deWxxhM66wkQ6nTgNAZWxk3AOVUWEXa/hbt4tGg7Ktlu4QmNs nxKRID7wBlGJt1B44kg3FldhBUnw+qU21Qvd7SCMCqW49U1uSGmrrADV62Z0NjkKVXIM 4RUQe8crir8X0VitZ62faDhdxTlMSWma3unNZ+e1ZOafTSuQdeL7KNma2zPBaYf1iav3 i7bOS6ybR9Ub9IujCYvtDAhaBiPkJARMCYVxv1qoAkNW4GG3JewKVP81GXDr0BWnD+zI n5ew== X-Gm-Message-State: ALKqPwfXw+8jiNBn8A9aebLo+E5Aww72taJD9LrGyNC2gX1A7zQrLfHf vAO9u8pNrGWZx9pDyAU0QsaZPjqWCDo= X-Google-Smtp-Source: AB8JxZpPNJsMZctQxNrZJFdFHNjYxJhWnGV9rxxyQkQiq16HaYq0lMwfeQLesj/xEqy8uNHnkyN+NA== X-Received: by 2002:a2e:3e0c:: with SMTP id l12-v6mr14922141lja.23.1526974479109; Tue, 22 May 2018 00:34:39 -0700 (PDT) Received: from localhost.localdomain ([95.153.133.225]) by smtp.gmail.com with ESMTPSA id p20-v6sm2912142ljj.23.2018.05.22.00.34.37 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 22 May 2018 00:34:38 -0700 (PDT) From: Artem Blagodarenko To: linux-ext4@vger.kernel.org Cc: adilger.kernel@dilger.ca, alexey.lyashkov@gmail.com, Alexey Lyashkov , Vladimir Saveliev Subject: [PATCH] tests: non root user for m_quota test Date: Tue, 22 May 2018 10:33:17 +0300 Message-Id: <20180522073317.1025-1-artem.blagodarenko@gmail.com> X-Mailer: git-send-email 2.14.3 (Apple Git-98) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Alexey Lyashkov When mke2fs -O quota is ran as not root it creates root directory with non-root uid and gid. Lost+found is created with root uid and gid. mke2fs allocates records in quota files for both root and non-root uid and gids. When mke2fs -O quota is ran as root - quota files only gets records for root uid and gid. In later case number is free blocks is bigger and there outputs of dumpe2fs differ. The fix is to check who runs the test and use appropriate expect.1. Xyratex-bug-id: MRP-788 Signed-off-by: Vladimir Saveliev Change-Id: I3b4a64591f76797c301ae6c35b2c056461ea9a75 Reviewed-on: http://morpheus.xyus.xyratex.com:8443/gerrit/328 Reviewed-by: Alexander Boyko Reviewed-by: Andrew Perepechko Tested-by: Alexander Lezhoev Reviewed-by: Vitaly Fertman --- tests/m_quota/expect.noroot | 157 ++++++++++++++++++++++++++++++++++++++++++++ tests/m_quota/script | 5 ++ 2 files changed, 162 insertions(+) create mode 100644 tests/m_quota/expect.noroot diff --git a/tests/m_quota/expect.noroot b/tests/m_quota/expect.noroot new file mode 100644 index 00000000..5bdbe96f --- /dev/null +++ b/tests/m_quota/expect.noroot @@ -0,0 +1,157 @@ +Creating filesystem with 131072 1k blocks and 32768 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729 + +Allocating group tables: done +Writing inode tables: done +Writing superblocks and filesystem accounting information: done + +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super quota +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +test_filesys: 11/32768 files (18.2% non-contiguous), 5709/131072 blocks +Exit status is 0 +Filesystem volume name: +Last mounted on: +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super quota +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 32768 +Block count: 131072 +Reserved block count: 6553 +Free blocks: 125363 +Free inodes: 32757 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Reserved GDT blocks: 256 +Blocks per group: 8192 +Fragments per group: 8192 +Inodes per group: 2048 +Inode blocks per group: 256 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 128 +Default directory hash: half_md4 +User quota inode: 3 +Group quota inode: 4 + + +Group 0: (Blocks 1-8192) + Primary superblock at 1, Group descriptors at 2-2 + Reserved GDT blocks at 3-258 + Block bitmap at 259 (+258), Inode bitmap at 260 (+259) + Inode table at 261-516 (+260) + 7644 free blocks, 2037 free inodes, 2 directories + Free blocks: 549-8192 + Free inodes: 12-2048 +Group 1: (Blocks 8193-16384) + Backup superblock at 8193, Group descriptors at 8194-8194 + Reserved GDT blocks at 8195-8450 + Block bitmap at 8451 (+258), Inode bitmap at 8452 (+259) + Inode table at 8453-8708 (+260) + 7676 free blocks, 2048 free inodes, 0 directories + Free blocks: 8709-16384 + Free inodes: 2049-4096 +Group 2: (Blocks 16385-24576) + Block bitmap at 16385 (+0), Inode bitmap at 16386 (+1) + Inode table at 16387-16642 (+2) + 7934 free blocks, 2048 free inodes, 0 directories + Free blocks: 16643-24576 + Free inodes: 4097-6144 +Group 3: (Blocks 24577-32768) + Backup superblock at 24577, Group descriptors at 24578-24578 + Reserved GDT blocks at 24579-24834 + Block bitmap at 24835 (+258), Inode bitmap at 24836 (+259) + Inode table at 24837-25092 (+260) + 7676 free blocks, 2048 free inodes, 0 directories + Free blocks: 25093-32768 + Free inodes: 6145-8192 +Group 4: (Blocks 32769-40960) + Block bitmap at 32769 (+0), Inode bitmap at 32770 (+1) + Inode table at 32771-33026 (+2) + 7934 free blocks, 2048 free inodes, 0 directories + Free blocks: 33027-40960 + Free inodes: 8193-10240 +Group 5: (Blocks 40961-49152) + Backup superblock at 40961, Group descriptors at 40962-40962 + Reserved GDT blocks at 40963-41218 + Block bitmap at 41219 (+258), Inode bitmap at 41220 (+259) + Inode table at 41221-41476 (+260) + 7676 free blocks, 2048 free inodes, 0 directories + Free blocks: 41477-49152 + Free inodes: 10241-12288 +Group 6: (Blocks 49153-57344) + Block bitmap at 49153 (+0), Inode bitmap at 49154 (+1) + Inode table at 49155-49410 (+2) + 7934 free blocks, 2048 free inodes, 0 directories + Free blocks: 49411-57344 + Free inodes: 12289-14336 +Group 7: (Blocks 57345-65536) + Backup superblock at 57345, Group descriptors at 57346-57346 + Reserved GDT blocks at 57347-57602 + Block bitmap at 57603 (+258), Inode bitmap at 57604 (+259) + Inode table at 57605-57860 (+260) + 7676 free blocks, 2048 free inodes, 0 directories + Free blocks: 57861-65536 + Free inodes: 14337-16384 +Group 8: (Blocks 65537-73728) + Block bitmap at 65537 (+0), Inode bitmap at 65538 (+1) + Inode table at 65539-65794 (+2) + 7934 free blocks, 2048 free inodes, 0 directories + Free blocks: 65795-73728 + Free inodes: 16385-18432 +Group 9: (Blocks 73729-81920) + Backup superblock at 73729, Group descriptors at 73730-73730 + Reserved GDT blocks at 73731-73986 + Block bitmap at 73987 (+258), Inode bitmap at 73988 (+259) + Inode table at 73989-74244 (+260) + 7676 free blocks, 2048 free inodes, 0 directories + Free blocks: 74245-81920 + Free inodes: 18433-20480 +Group 10: (Blocks 81921-90112) + Block bitmap at 81921 (+0), Inode bitmap at 81922 (+1) + Inode table at 81923-82178 (+2) + 7934 free blocks, 2048 free inodes, 0 directories + Free blocks: 82179-90112 + Free inodes: 20481-22528 +Group 11: (Blocks 90113-98304) + Block bitmap at 90113 (+0), Inode bitmap at 90114 (+1) + Inode table at 90115-90370 (+2) + 7934 free blocks, 2048 free inodes, 0 directories + Free blocks: 90371-98304 + Free inodes: 22529-24576 +Group 12: (Blocks 98305-106496) + Block bitmap at 98305 (+0), Inode bitmap at 98306 (+1) + Inode table at 98307-98562 (+2) + 7934 free blocks, 2048 free inodes, 0 directories + Free blocks: 98563-106496 + Free inodes: 24577-26624 +Group 13: (Blocks 106497-114688) + Block bitmap at 106497 (+0), Inode bitmap at 106498 (+1) + Inode table at 106499-106754 (+2) + 7934 free blocks, 2048 free inodes, 0 directories + Free blocks: 106755-114688 + Free inodes: 26625-28672 +Group 14: (Blocks 114689-122880) + Block bitmap at 114689 (+0), Inode bitmap at 114690 (+1) + Inode table at 114691-114946 (+2) + 7934 free blocks, 2048 free inodes, 0 directories + Free blocks: 114947-122880 + Free inodes: 28673-30720 +Group 15: (Blocks 122881-131071) + Block bitmap at 122881 (+0), Inode bitmap at 122882 (+1) + Inode table at 122883-123138 (+2) + 7933 free blocks, 2048 free inodes, 0 directories + Free blocks: 123139-131071 + Free inodes: 30721-32768 diff --git a/tests/m_quota/script b/tests/m_quota/script index 32a12b95..b5e3b90c 100644 --- a/tests/m_quota/script +++ b/tests/m_quota/script @@ -1,4 +1,9 @@ DESCRIPTION="enable quota feature on mkfs" +if [ $(id -u) = 0 ]; then + cp $test_dir/expect.root $test_dir/expect.1 +else + cp $test_dir/expect.noroot $test_dir/expect.1 +fi FS_SIZE=131072 MKE2FS_OPTS="-O quota,project -I 256" if [ "$QUOTA" != "y" ]; then