diff mbox series

[u-boot,1/2] fs: btrfs: skip xattrs in directory listing

Message ID 20210209180508.22132-1-marek.behun@nic.cz (mailing list archive)
State New, archived
Headers show
Series [u-boot,1/2] fs: btrfs: skip xattrs in directory listing | expand

Commit Message

Marek Behún Feb. 9, 2021, 6:05 p.m. UTC
Skip xattrs in directory listing. U-Boot filesystem drivers do not list
xattrs.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: David Sterba <dsterba@suse.com>
Cc: Qu Wenruo <wqu@suse.com>
Cc: Tom Rini <trini@konsulko.com>
---
 fs/btrfs/btrfs.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Qu Wenruo Feb. 10, 2021, 12:20 a.m. UTC | #1
On 2021/2/10 上午2:05, Marek Behún wrote:
> Skip xattrs in directory listing. U-Boot filesystem drivers do not list
> xattrs.
>
> Signed-off-by: Marek Behún <marek.behun@nic.cz>
> Cc: David Sterba <dsterba@suse.com>
> Cc: Qu Wenruo <wqu@suse.com>
> Cc: Tom Rini <trini@konsulko.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu
> ---
>   fs/btrfs/btrfs.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/btrfs.c b/fs/btrfs/btrfs.c
> index 346b2c4341..6b4c5feb53 100644
> --- a/fs/btrfs/btrfs.c
> +++ b/fs/btrfs/btrfs.c
> @@ -29,7 +29,6 @@ static int show_dir(struct btrfs_root *root, struct extent_buffer *eb,
>   		[BTRFS_FT_FIFO]		= "FIFO",
>   		[BTRFS_FT_SOCK]		= "SOCK",
>   		[BTRFS_FT_SYMLINK]	= "SYMLINK",
> -		[BTRFS_FT_XATTR]	= "XATTR"
>   	};
>   	u8 type = btrfs_dir_type(eb, di);
>   	char namebuf[BTRFS_NAME_LEN];
> @@ -38,6 +37,10 @@ static int show_dir(struct btrfs_root *root, struct extent_buffer *eb,
>   	time_t mtime;
>   	int ret = 0;
>
> +	/* skip XATTRs in directory listing */
> +	if (type == BTRFS_FT_XATTR)
> +		return 0;
> +
>   	btrfs_dir_item_key_to_cpu(eb, di, &key);
>
>   	if (key.type == BTRFS_ROOT_ITEM_KEY) {
>
Tom Rini Feb. 25, 2021, 1:24 p.m. UTC | #2
On Tue, Feb 09, 2021 at 07:05:07PM +0100, Marek Behún wrote:

> Skip xattrs in directory listing. U-Boot filesystem drivers do not list
> xattrs.
> 
> Signed-off-by: Marek Behún <marek.behun@nic.cz>
> Cc: David Sterba <dsterba@suse.com>
> Cc: Qu Wenruo <wqu@suse.com>
> Cc: Tom Rini <trini@konsulko.com>
> Reviewed-by: Qu Wenruo <wqu@suse.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/fs/btrfs/btrfs.c b/fs/btrfs/btrfs.c
index 346b2c4341..6b4c5feb53 100644
--- a/fs/btrfs/btrfs.c
+++ b/fs/btrfs/btrfs.c
@@ -29,7 +29,6 @@  static int show_dir(struct btrfs_root *root, struct extent_buffer *eb,
 		[BTRFS_FT_FIFO]		= "FIFO",
 		[BTRFS_FT_SOCK]		= "SOCK",
 		[BTRFS_FT_SYMLINK]	= "SYMLINK",
-		[BTRFS_FT_XATTR]	= "XATTR"
 	};
 	u8 type = btrfs_dir_type(eb, di);
 	char namebuf[BTRFS_NAME_LEN];
@@ -38,6 +37,10 @@  static int show_dir(struct btrfs_root *root, struct extent_buffer *eb,
 	time_t mtime;
 	int ret = 0;
 
+	/* skip XATTRs in directory listing */
+	if (type == BTRFS_FT_XATTR)
+		return 0;
+
 	btrfs_dir_item_key_to_cpu(eb, di, &key);
 
 	if (key.type == BTRFS_ROOT_ITEM_KEY) {