Thread (16 messages) 16 messages, 3 authors, 2024-10-31

Re: [PATCH v8 8/9] tmpfs: Expose filesystem features via sysfs

From: André Almeida <andrealmeid@igalia.com>
Date: 2024-10-31 19:12:06
Also in: linux-btrfs, linux-ext4, linux-fsdevel, linux-mm, lkml, llvm
Subsystem: memory management, the rest, tmpfs (shmem filesystem) · Maintainers: Andrew Morton, Linus Torvalds, Hugh Dickins

Em 31/10/2024 14:31, André Almeida escreveu:
Hi Nathan,

Em 31/10/2024 02:18, Nathan Chancellor escreveu:
quoted
Hi André,
[...]
quoted
If there is any patch I can test or further information I can provide, I
am more than happy to do so.
I found the issue, was just the DEVICE_ macro that I wasn't supposed to 
use inside of tmpfs, this diff solved the error for me, I will send a 
proper patch in a moment:

-- >8 --
diff --git a/mm/shmem.c b/mm/shmem.c
index 971e6f1184a5..db52c34d5020 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -5551,12 +5551,21 @@ EXPORT_SYMBOL_GPL(shmem_read_mapping_page_gfp);

  #if defined(CONFIG_SYSFS) && defined(CONFIG_TMPFS)
  #if IS_ENABLED(CONFIG_UNICODE)
-static DEVICE_STRING_ATTR_RO(casefold, 0444, "supported");
+static ssize_t casefold_show(struct kobject *kobj, struct 
kobj_attribute *a,
+                       char *buf)
+{
+               return sysfs_emit(buf, "supported\n");
+}
+static struct kobj_attribute tmpfs_attr_casefold = {
+               .attr = { .name = "casefold", .mode = 0444 },
+               .show = casefold_show,
+               .store = NULL,
+};
  #endif

  static struct attribute *tmpfs_attributes[] = {
  #if IS_ENABLED(CONFIG_UNICODE)
-       &dev_attr_casefold.attr.attr,
+       &tmpfs_attr_casefold.attr,
  #endif
         NULL
  };
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help