From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id AC55F945CE for ; Fri, 9 Feb 2024 15:06:29 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8DC793A6CB for ; Fri, 9 Feb 2024 15:05:59 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 9 Feb 2024 15:05:58 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id C4C394683A for ; Fri, 9 Feb 2024 15:05:57 +0100 (CET) From: Gabriel Goller To: pbs-devel@lists.proxmox.com Date: Fri, 9 Feb 2024 15:05:52 +0100 Message-ID: <20240209140554.123703-1-g.goller@proxmox.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.107 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [create.rs, man7.org] Subject: [pbs-devel] [PATCH proxmox-backup] fix #4975: client: ignore E2BIG on `listxattr` X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Feb 2024 14:06:29 -0000 Regardless of the file system, the vfs layer imposes a 64kB limit to the extended attributes of a file (and a maximum of 65536 entries) [0][1]. If a file has more than 65536 xattrs, the `listxattr` syscall returns a E2BIG error. To prevent the proxmox-backup-client from crashing, ignore this error and print a warning. This includes the file content but ignores the xattrs. A user ran into this by moving a file from linux to windows to solaris and onto a zfs dataset. This created xattrs in the magnitude of a MB, which works on ZFS but cannot be read using listxattr. [0]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/xattr.c#n834 [1]: https://www.man7.org/linux/man-pages/man2/listxattr.2.html#BUGS Signed-off-by: Gabriel Goller --- pbs-client/src/pxar/create.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pbs-client/src/pxar/create.rs b/pbs-client/src/pxar/create.rs index e7053d9e..2347af7b 100644 --- a/pbs-client/src/pxar/create.rs +++ b/pbs-client/src/pxar/create.rs @@ -1,6 +1,7 @@ use std::collections::{HashMap, HashSet}; use std::ffi::{CStr, CString, OsStr}; use std::fmt; +use std::fs::read_link; use std::io::{self, Read}; use std::os::unix::ffi::OsStrExt; use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, OwnedFd, RawFd}; @@ -829,6 +830,13 @@ fn get_xattr_fcaps_acl( fs_feature_flags.remove(Flags::WITH_XATTRS); return Ok(()); } + Err(Errno::E2BIG) => { + log::warn!( + "WARNING: {} - failed to read xattrs, too big (E2BIG)", + read_link(proc_path).map_or("".to_string(), |p| p.display().to_string()) + ); + return Ok(()); + } Err(Errno::EBADF) => return Ok(()), // symlinks Err(err) => return Err(err).context("failed to read xattrs"), }; -- 2.43.0