From patchwork Thu Jan 26 01:06:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 9538269 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CC7CA604A8 for ; Thu, 26 Jan 2017 01:07:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB6FC27E33 for ; Thu, 26 Jan 2017 01:07:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B059127F99; Thu, 26 Jan 2017 01:07:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 857DA27F17 for ; Thu, 26 Jan 2017 01:07:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752317AbdAZBH1 (ORCPT ); Wed, 25 Jan 2017 20:07:27 -0500 Received: from mail-pg0-f46.google.com ([74.125.83.46]:33086 "EHLO mail-pg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752061AbdAZBHW (ORCPT ); Wed, 25 Jan 2017 20:07:22 -0500 Received: by mail-pg0-f46.google.com with SMTP id 204so68811421pge.0 for ; Wed, 25 Jan 2017 17:07:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=uA+fHrSQBeSP+zuOW/1OLs2pQRznCKblhBVTSG7byiQ=; b=aKxfGA2w6/Z1mqsBo0qHQP+vsd4Tic572kNlfGxXWvJ5IOdS7JUUKRbYHDcqUq3n/M 6GzP06cRURQPwqwZH7l6EkNPUZwQv4WdCnU7CqyuWVwTdj4slEUyIP0imqFkRBTf3CIr 4MnGafAnR51SJenC+Aa0Bir8eyJzbCzloODWpAr9O1F9YqcOAM/ofmeTEQ5o/KjEHeI1 PV4Ce7aNsPLrE0FXi9j13F1jcjyKZuIj+rOk2nLdtN1zmwwpG9QKGN9yOgFNXqh5Kxsf snffbn66OJGXq8usU7pMdIj6eY7hXHQ++wkN8SuEmXMEEmy8ucqa/FQYmh729caQjywX reZw== 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:in-reply-to :references:in-reply-to:references; bh=uA+fHrSQBeSP+zuOW/1OLs2pQRznCKblhBVTSG7byiQ=; b=hWJO/s1TnWid11YA0AvmRankHQcMRgyba9EfOOkgXA2N+Cvg1YkWPXZP+q60DQKJIA 4B8lv2c5lbPNDqyQ8JRXh5nP5LGqxDEmymC+R7jWgutMC/8RyPYnOqBsaxoYv1Z9N4Ki GdmdC+9F8jL2Kx/BlVB3ds/OCHmuawERs3dIcNynqOUZ0hynL1m1PbLWBOkgfE5SnWXP Kx30HTVCGiPZxPghS4p43nygNnUhVvPJkn4/4sk3T+W4k9sU2cIlaFTq9Ow1BeE3P/7k kH2WO0ymQ6uUx1YaH9G/2f3re4u5qvJUJLb4EkeeIVNd1O3dVuw8IB6gmnt691r66A37 zrdA== X-Gm-Message-State: AIkVDXJ1Uk3lm+xyvYH9/EDLEF60+8JJHMpX/CNYUIwB7hRb4s8lOicVr7fIZh/F9ncK07eW X-Received: by 10.98.215.70 with SMTP id v6mr233355pfl.141.1485392842265; Wed, 25 Jan 2017 17:07:22 -0800 (PST) Received: from localhost.localdomain ([2601:602:8801:8110:e6a7:a0ff:fe0b:c9a8]) by smtp.gmail.com with ESMTPSA id w25sm146848pge.9.2017.01.25.17.07.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jan 2017 17:07:21 -0800 (PST) From: Omar Sandoval To: linux-btrfs@vger.kernel.org Cc: Chris Murphy , Andreas Gruenbacher , stable@vger.kernel.org, kernel-team@fb.com Subject: [PATCH v2 2/3] Btrfs: disable xattr operations on subvolume directories Date: Wed, 25 Jan 2017 17:06:39 -0800 Message-Id: <807c4c0c54fe611c4d0fb399aee36e241e2c6846.1485392101.git.osandov@fb.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Omar Sandoval When you snapshot a subvolume containing a subvolume, you get a placeholder directory where the subvolume would be. These directory inodes have ->i_ops set to btrfs_dir_ro_inode_operations. Previously, these i_ops didn't include the xattr operation callbacks. The conversion to xattr_handlers missed this case, leading to bogus attempts to set xattrs on these inodes. This manifested itself as failures when running delayed inodes. To fix this, clear IOP_XATTR in ->i_opflags on these inodes. Fixes: 6c6ef9f26e59 ("xattr: Stop calling {get,set,remove}xattr inode operations") Cc: Andreas Gruenbacher Reported-by: Chris Murphy Tested-by: Chris Murphy Cc: # 4.9.x Signed-off-by: Omar Sandoval Reviewed-by: David Sterba --- fs/btrfs/inode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index ae3989c22718..924f3583a04d 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -5707,6 +5707,7 @@ static struct inode *new_simple_dir(struct super_block *s, inode->i_ino = BTRFS_EMPTY_SUBVOL_DIR_OBJECTID; inode->i_op = &btrfs_dir_ro_inode_operations; + inode->i_opflags &= ~IOP_XATTR; inode->i_fop = &simple_dir_operations; inode->i_mode = S_IFDIR | S_IRUGO | S_IWUSR | S_IXUGO; inode->i_mtime = current_time(inode);