From patchwork Fri Dec 11 15:14:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Gruenbacher X-Patchwork-Id: 7830761 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9B534BEEE1 for ; Fri, 11 Dec 2015 15:14:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D09D3204C9 for ; Fri, 11 Dec 2015 15:14:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F312C20495 for ; Fri, 11 Dec 2015 15:14:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753523AbbLKPOY (ORCPT ); Fri, 11 Dec 2015 10:14:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49583 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751043AbbLKPOY (ORCPT ); Fri, 11 Dec 2015 10:14:24 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 381D519CBD1; Fri, 11 Dec 2015 15:14:24 +0000 (UTC) Received: from nux.redhat.com (vpn1-6-237.ams2.redhat.com [10.36.6.237]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tBBFEKBv006912; Fri, 11 Dec 2015 10:14:21 -0500 From: Andreas Gruenbacher To: Al Viro Cc: Andreas Gruenbacher , LKML , linux-fsdevel Subject: [PATCH] nfs: Fix listxattr regression (2) Date: Fri, 11 Dec 2015 16:14:19 +0100 Message-Id: <1449846859-19375-1-git-send-email-agruenba@redhat.com> References: <1449836146-5674-1-git-send-email-agruenba@redhat.com> <20151211125528.GJ20997@ZenIV.linux.org.uk> In-Reply-To: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Al, here is another fix for the same botched nfs commit. Could you please also merge / fold that? Sorry for the mess. Thanks, Andreas --- Fix another regression introduced in d77ae742: listxattr ended up always failing with -ERANGE on NFSv4.2 mounts with security label support. Signed-off-by: Andreas Gruenbacher --- fs/nfs/nfs4proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index e9db118..c57d133 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -6296,8 +6296,8 @@ nfs4_listxattr_nfs4_label(struct inode *inode, char *list, size_t list_len) int len = 0; if (nfs_server_capable(inode, NFS_CAP_SECURITY_LABEL)) { - len = security_inode_listsecurity(inode, list, len); - if (len > list_len) + len = security_inode_listsecurity(inode, list, list_len); + if (list_len && len > list_len) return -ERANGE; } return len;