From patchwork Fri Feb 15 12:45:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemanth Kumar X-Patchwork-Id: 2147321 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 44BE7DF24C for ; Fri, 15 Feb 2013 13:09:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161261Ab3BOMpm (ORCPT ); Fri, 15 Feb 2013 07:45:42 -0500 Received: from mail-pb0-f41.google.com ([209.85.160.41]:45891 "EHLO mail-pb0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936012Ab3BOMph (ORCPT ); Fri, 15 Feb 2013 07:45:37 -0500 Received: by mail-pb0-f41.google.com with SMTP id um15so602679pbc.14 for ; Fri, 15 Feb 2013 04:45:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=40+G5LFdFi7YRHaLeIfqgMI7DhwLSfQ5XRHFwZjz4bU=; b=w5FJjmsfq3/Vtf7hKL/eYQdJ2GRVUsl44aoDn+r3okJDcDPVYDi4Zg43jOGa4jVROe k2M3teVD2gMpL5/ucmuDO6jvirbHjIsmyVRT7CN/WiknVTA/M6T6P5sO//9/ZFJqf1mB grUeypAqG+a9a4cYyMfGxpakNZ0Rny3YLInzXQi1GrKCsCTBjq2VCSx+jYZT31QWA/l4 8AIIvqFIN797fm6iCRA6gJLHqRa0a02Jer20uP2cAt8HrolqgOU1bcG54+FnaIHAdVWv 8ZTHrm3z/AWSp4P79heCgrAwvb/u6PeHRngmzGT1O1A98V1s4mNTisdaHXy4ipD2U6lC RikA== X-Received: by 10.68.1.67 with SMTP id 3mr5688121pbk.78.1360932336666; Fri, 15 Feb 2013 04:45:36 -0800 (PST) Received: from localhost.localdomain ([117.192.105.141]) by mx.google.com with ESMTPS id z6sm67541073pav.3.2013.02.15.04.45.31 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:45:35 -0800 (PST) From: Hemanth Kumar To: linux-btrfs@vger.kernel.org, xfs@oss.sgi.com Cc: skjmca51@gmail.com, ganeshkumar14@gmail.com, kirantpatil@gmail.com, praneethu.u@gmail.com, chethan.casey@gmail.com, sensille@gmx.net, bo.li.liu@oracle.com, hugo@carfax.org.uk, sandeen@redhat.com, Hemanth Kumar Subject: [btrfs-progs] Btrfs quotas testing Date: Fri, 15 Feb 2013 18:15:24 +0530 Message-Id: <1360932324-2722-1-git-send-email-hemanthkumar51@gmail.com> X-Mailer: git-send-email 1.8.1.2 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Signed-off-by: Hemanth Kumar --- quotas.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 quotas.sh diff --git a/quotas.sh b/quotas.sh new file mode 100644 index 0000000..7e64578 --- /dev/null +++ b/quotas.sh @@ -0,0 +1,30 @@ +#! /bin/bash +# Btrfs quotas test case +# Hi all, +# This is shell script to test the quotas feature of Btrfs +# I created Btrfs filesystem on a new +# partition, then activated quota management ('btrfs quota enable'), and +# created a few subvolumes. +# I have lmited the quota to 2mb and tried filling it +# its working as expected + + +cleanup() +{ + btrfs subvolume delete $TEST_DIR/vol1 + btrfs subvolume disable $TEST_DIR +} + +#trap "_cleanup ; exit \$status" 0 1 2 3 15 + +btrfs quota enable $TEST_DIR +echo "quota enabled on $TEST_DEV" +btrfs subvolume create $TEST_DIR/vol1 +echo "vol1 created" +btrfs qgroup show $TEST_DIR +btrfs qgroup limit 2m $TEST_DIR/vol1 +echo "qgroup limited to 2mb" +dd if=$TEST_DEV of=$TEST_DIR/vol1/file1 bs=3M count=1 +echo "tried to write 3m worth data" +cleanup +exit