Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4826446ybl; Wed, 22 Jan 2020 05:28:35 -0800 (PST) X-Google-Smtp-Source: APXvYqzKCxgwjxc5lxVgTh1UYDEPayppeiTZJx2fSnfzbExwfXQFAzwdCXrJb5fog8bBzpOOE8pP X-Received: by 2002:a54:4106:: with SMTP id l6mr6658530oic.76.1579699715581; Wed, 22 Jan 2020 05:28:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699715; cv=none; d=google.com; s=arc-20160816; b=CU/LESyDAW11Y42fp7l/aQNd+igHWg31xOJiJXECCJxyQ2E/j3T7Uj35AlYGicADJ4 eyY+k6+us3huxhALIu6pUJNqc3yvDjDbU7TpcH4Mzf2IVvIZ0gd95fYL6sPph+YVwrYL o6rN++kU8ovoOILv0I9KJR2LNUJC4dXRgVjxdYjmLwAwaK8FoUMjY3OgSS1N9KnM/TuU HG2bwW6J6MRL2gFWoxcfrtOsYYf6uYI8XfHYb0qJ3pCx8FeT9veWyAzSVa7tNmaDcFQp kq6nviWw9IHhUCj8rODZPIr35TTTL7b25/Ntp/qSnYFmGBuIDWTOTFpQq4y65fRHV0uw PyHw== 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=PKdY+kigqDGqWJJdM0LaqcybZDSd8S7uCEQbRbZ04JuNibwk6FhJRtLVoq8y+7Jdz3 Te8TRFyFTUJ5yCpzfBX5MSGpeh38OF9zbLfUWB3yVOcY3HL/70CyXSZ/9pZtxPYDDCQ1 XFfvYsCZMps/EsrSo+RTkKkZ3Cm+Wt6X9O6tO4dMPY6yOJbAfpUiGe8K5tI4Wayt3i7n EpC0Y2DyO9VRshwD5FMzeJHd8KMSD4JpxJW5hYi8RvvxjAEONDKJM4YT50rxv0Munzrg 8F8bxzsFlkged5ScVlLiJE36mD0sPVcV//mFx0tzzVnDOWQBOxMxCKK/jlqWsowtPTdX qLCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LYJpM0aK; 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 l26si24661659otn.48.2020.01.22.05.28.24; Wed, 22 Jan 2020 05:28:35 -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=LYJpM0aK; 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 S1729340AbgAVN1A (ORCPT + 99 others); Wed, 22 Jan 2020 08:27:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:48126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725870AbgAVN06 (ORCPT ); Wed, 22 Jan 2020 08:26:58 -0500 Received: from localhost (unknown [84.241.205.26]) (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 BB8EC2467B; Wed, 22 Jan 2020 13:26:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699617; bh=e5CRW54dsq2bYqXNwFy3jRK3OjNNRYCjwFha6ZoH1FY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LYJpM0aKCU7ng5ZDjM2ZixiQIul/vROePLxI11qQ9fi2lq88LoaKC1DMQrzRa5YNz lio2RTfc5F4EyUiFNOe9Wc2KTzEviCt/sZBjXrqwrtDEVyT+rbYvb+d9iGLSggTtE3 /EsaXBCaHSiZZa4yrpEo+m4FcN0bQ7r44anGYc6M= 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 5.4 198/222] reiserfs: fix handling of -EOPNOTSUPP in reiserfs_for_each_xattr Date: Wed, 22 Jan 2020 10:29:44 +0100 Message-Id: <20200122092847.885279414@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@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; }