Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4641039ybl; Wed, 22 Jan 2020 01:51:39 -0800 (PST) X-Google-Smtp-Source: APXvYqyKLfU31/h5pxp9aNOBxBGB3IyuAwqg+gYbDCHy8LEVWYI4JHOyXA+sHaKvim9o2IYnM5GC X-Received: by 2002:aca:d78b:: with SMTP id o133mr6365835oig.163.1579686699468; Wed, 22 Jan 2020 01:51:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579686699; cv=none; d=google.com; s=arc-20160816; b=HA5nRvEPivS5mrby4xaqxmCaS4nehzHVmdBMgu1xruQwA9nRuKSIJsBXg2SdtM8fkw GPZlknZEZmE9VNBuS/KNou6W6ogb6ydbRpc38wTMqU9YH5h9EBpZZ1msv+D7rIgeiGaN 1OLoPEjn83PLU2fkifzzmtPsQN9Nq/9SmJGK2J+Jd3xgwIxFd50TOA6CHHPSf8XpWahO SG6qo+p/gz1F4f3TghTUJCk8c3QSK/N9zw7xQo4xe7RnRsYzAOm1sa8+ov1I/Mo3Qsvi 2iLq4INUm7iWPnexrAhxwT74mU9WP/7shyvZtQsL6evqVF75n8qzHMZQMcjVm9bj0apY 0DzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6l/+5V/t68uvaW/c8wSbvwD4BjXo2CCLydmZo8sJEKs=; b=Sod7OVB+u7WhLgSCiDG9bkpY1Lw3buVVmfbK0a9EvfYeW1FlhQzSP+otDQaOXVPHc3 TzYfmJhVvfh4qaSugoek4Uu+oK55cJddcD9AAq7tYxiYzPd6s1imXDCEMgz+oJz+jeRg 8UZ18Bt+VAv9WkdMvnKd59FrBvC7VLN5+776tNShyx4SzhOGdG4DNc+/1CzXetadiOIT QFJAsOKxchH+1ABIb76kZK2bimoW5+szNMKM0vXyWfun0X1tE+H8heBU3tIFMb+c3ZTf qkBES2gflcTXF3Au8mxY8p8C2hdXD0YS3Zz7T3thZEv+Bv0K3ITr9ypzHG5BCwHoXvCV kSFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HYdiF3yB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1si23196592otp.70.2020.01.22.01.51.27; Wed, 22 Jan 2020 01:51:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HYdiF3yB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733241AbgAVJjf (ORCPT + 99 others); Wed, 22 Jan 2020 04:39:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:57586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733229AbgAVJjd (ORCPT ); Wed, 22 Jan 2020 04:39:33 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5F22F24685; Wed, 22 Jan 2020 09:39:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579685972; bh=e5CRW54dsq2bYqXNwFy3jRK3OjNNRYCjwFha6ZoH1FY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HYdiF3yBx8N0SMvuu3mQE1KFjaIbhdWiljuqJ2dwlHu24BZSViJYfLqxFhvSLjpkb 2F6Wq6Ty7lWhnObpmWGUfVNOIggbUeG0QHINjHUniEQRicj6UUMfwGX7FRAQ8FIGm/ vYfOQoiG5l7IU+aSq53SPU47IclvapctOvDYcTw0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Brunnbauer , Jeff Mahoney , Jan Kara Subject: [PATCH 4.14 56/65] reiserfs: fix handling of -EOPNOTSUPP in reiserfs_for_each_xattr Date: Wed, 22 Jan 2020 10:29:41 +0100 Message-Id: <20200122092759.623911907@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092750.976732974@linuxfoundation.org> References: <20200122092750.976732974@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeff Mahoney commit 394440d469413fa9b74f88a11f144d76017221f2 upstream. Commit 60e4cf67a58 (reiserfs: fix extended attributes on the root directory) introduced a regression open_xa_root started returning -EOPNOTSUPP but it was not handled properly in reiserfs_for_each_xattr. When the reiserfs module is built without CONFIG_REISERFS_FS_XATTR, deleting an inode would result in a warning and chowning an inode would also result in a warning and then fail to complete. With CONFIG_REISERFS_FS_XATTR enabled, the xattr root would always be present for read-write operations. This commit handles -EOPNOSUPP in the same way -ENODATA is handled. Fixes: 60e4cf67a582 ("reiserfs: fix extended attributes on the root directory") CC: stable@vger.kernel.org # Commit 60e4cf67a58 was picked up by stable Link: https://lore.kernel.org/r/20200115180059.6935-1-jeffm@suse.com Reported-by: Michael Brunnbauer Signed-off-by: Jeff Mahoney Signed-off-by: Jan Kara Signed-off-by: Greg Kroah-Hartman --- fs/reiserfs/xattr.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c @@ -319,8 +319,12 @@ static int reiserfs_for_each_xattr(struc out_dir: dput(dir); out: - /* -ENODATA isn't an error */ - if (err == -ENODATA) + /* + * -ENODATA: this object doesn't have any xattrs + * -EOPNOTSUPP: this file system doesn't have xattrs enabled on disk. + * Neither are errors + */ + if (err == -ENODATA || err == -EOPNOTSUPP) err = 0; return err; }