From patchwork Thu Apr 8 20:35:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: R Harshavardhana X-Patchwork-Id: 91508 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o38KZtGq011734 for ; Thu, 8 Apr 2010 20:35:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933511Ab0DHUfi (ORCPT ); Thu, 8 Apr 2010 16:35:38 -0400 Received: from zp3.zcs.datasyncintra.net ([208.88.241.29]:11960 "EHLO zp3.zcs.datasyncintra.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933428Ab0DHUfh (ORCPT ); Thu, 8 Apr 2010 16:35:37 -0400 Received: from localhost (localhost [127.0.0.1]) by zp3.zcs.datasyncintra.net (Postfix) with ESMTP id 763C320C7 for ; Thu, 8 Apr 2010 15:35:36 -0500 (CDT) X-Virus-Scanned: amavisd-new at zp3.zcs.datasyncintra.net Received: from zp3.zcs.datasyncintra.net ([127.0.0.1]) by localhost (zp3.zcs.datasyncintra.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rG06CiSFB1yF for ; Thu, 8 Apr 2010 15:35:36 -0500 (CDT) Received: from localhost.localdomain (adsl-99-160-131-163.dsl.pltn13.sbcglobal.net [99.160.131.163]) (Authenticated sender: harsha@gluster.com) by zp3.zcs.datasyncintra.net (Postfix) with ESMTPSA id C25272071 for ; Thu, 8 Apr 2010 15:35:35 -0500 (CDT) From: Harshavardhana To: linux-btrfs@vger.kernel.org Subject: [PATCH] fs/btrfs: Return EPERM for rmdir on subvolumes and snapshots Date: Thu, 8 Apr 2010 13:35:31 -0700 Message-Id: <1270758931-5291-1-git-send-email-harsha@gluster.com> X-Mailer: git-send-email 1.6.6.1 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 08 Apr 2010 20:35:56 +0000 (UTC) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index a85b90c..c0fbe03 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2593,7 +2593,7 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry) if (inode->i_size > BTRFS_EMPTY_DIR_SIZE || inode->i_ino == BTRFS_FIRST_FREE_OBJECTID) - return -ENOTEMPTY; + return -EPERM; ret = btrfs_reserve_metadata_space(root, 5); if (ret)