From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Hongzhen Luo <hongzhen@linux.alibaba.com>, linux-erofs@lists.ozlabs.org
Subject: Re: [PATCH v10 2/2] erofs-utils: fsck: introduce exporting xattrs
Date: Sat, 14 Sep 2024 10:23:43 +0800 [thread overview]
Message-ID: <9a850f23-075a-464d-95ef-d8b62e59cd58@linux.alibaba.com> (raw)
In-Reply-To: <20240913072100.577753-2-hongzhen@linux.alibaba.com>
On 2024/9/13 15:21, Hongzhen Luo wrote:
> Currently `fsck --extract` does not support exporting
> extended attributes. This patch adds the `--xattrs` option
> to dump extended attributes and the `--no-xattrs` option to
> omit them (the default behavior).
>
> Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
> ---
It fails to build on MacOS, I've applied the following fix manually:
diff --git a/configure.ac b/configure.ac
index 945e254..9c1657b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -260,6 +260,7 @@ AC_CHECK_FUNCS(m4_flatten([
gettimeofday
lgetxattr
llistxattr
+ lsetxattr
memset
realpath
lseek64
diff --git a/fsck/main.c b/fsck/main.c
index b514a63..f20b767 100644
--- a/fsck/main.c
+++ b/fsck/main.c
@@ -470,8 +470,15 @@ static int erofsfsck_dump_xattrs(struct erofs_inode *inode)
break;
}
if (fsckcfg.extract_path)
+#ifdef HAVE_LSETXATTR
ret = lsetxattr(fsckcfg.extract_path, key, value, size,
0);
+#elif defined(__APPLE__)
+ ret = setxattr(fsckcfg.extract_path, key, value, size,
+ 0, XATTR_NOFOLLOW);
+#else
+ ret = -EOPNOTSUPP;
+#endif
else
ret = 0;
free(value);
Thanks,
Gao Xiang
prev parent reply other threads:[~2024-09-14 2:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-13 7:20 [PATCH v10 1/2] erofs-utils: lib: expose erofs_xattr_prefix_matches() Hongzhen Luo
2024-09-13 7:21 ` [PATCH v10 2/2] erofs-utils: fsck: introduce exporting xattrs Hongzhen Luo
2024-09-14 2:23 ` Gao Xiang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9a850f23-075a-464d-95ef-d8b62e59cd58@linux.alibaba.com \
--to=hsiangkao@linux.alibaba.com \
--cc=hongzhen@linux.alibaba.com \
--cc=linux-erofs@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.