Commit a39b5dbd authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'zonefs-5.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs

Pull zonefs update from Damien Le Moal:
 "A single change for this cycle to simplify handling of the memory page
  used as super block buffer during mount (from Fabio)"

* tag 'zonefs-5.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs:
  zonefs: Call page_address() on page acquired with GFP_KERNEL flag
parents f18d7309 6bac30bb
...@@ -1686,11 +1686,11 @@ static int zonefs_read_super(struct super_block *sb) ...@@ -1686,11 +1686,11 @@ static int zonefs_read_super(struct super_block *sb)
if (ret) if (ret)
goto free_page; goto free_page;
super = kmap(page); super = page_address(page);
ret = -EINVAL; ret = -EINVAL;
if (le32_to_cpu(super->s_magic) != ZONEFS_MAGIC) if (le32_to_cpu(super->s_magic) != ZONEFS_MAGIC)
goto unmap; goto free_page;
stored_crc = le32_to_cpu(super->s_crc); stored_crc = le32_to_cpu(super->s_crc);
super->s_crc = 0; super->s_crc = 0;
...@@ -1698,14 +1698,14 @@ static int zonefs_read_super(struct super_block *sb) ...@@ -1698,14 +1698,14 @@ static int zonefs_read_super(struct super_block *sb)
if (crc != stored_crc) { if (crc != stored_crc) {
zonefs_err(sb, "Invalid checksum (Expected 0x%08x, got 0x%08x)", zonefs_err(sb, "Invalid checksum (Expected 0x%08x, got 0x%08x)",
crc, stored_crc); crc, stored_crc);
goto unmap; goto free_page;
} }
sbi->s_features = le64_to_cpu(super->s_features); sbi->s_features = le64_to_cpu(super->s_features);
if (sbi->s_features & ~ZONEFS_F_DEFINED_FEATURES) { if (sbi->s_features & ~ZONEFS_F_DEFINED_FEATURES) {
zonefs_err(sb, "Unknown features set 0x%llx\n", zonefs_err(sb, "Unknown features set 0x%llx\n",
sbi->s_features); sbi->s_features);
goto unmap; goto free_page;
} }
if (sbi->s_features & ZONEFS_F_UID) { if (sbi->s_features & ZONEFS_F_UID) {
...@@ -1713,7 +1713,7 @@ static int zonefs_read_super(struct super_block *sb) ...@@ -1713,7 +1713,7 @@ static int zonefs_read_super(struct super_block *sb)
le32_to_cpu(super->s_uid)); le32_to_cpu(super->s_uid));
if (!uid_valid(sbi->s_uid)) { if (!uid_valid(sbi->s_uid)) {
zonefs_err(sb, "Invalid UID feature\n"); zonefs_err(sb, "Invalid UID feature\n");
goto unmap; goto free_page;
} }
} }
...@@ -1722,7 +1722,7 @@ static int zonefs_read_super(struct super_block *sb) ...@@ -1722,7 +1722,7 @@ static int zonefs_read_super(struct super_block *sb)
le32_to_cpu(super->s_gid)); le32_to_cpu(super->s_gid));
if (!gid_valid(sbi->s_gid)) { if (!gid_valid(sbi->s_gid)) {
zonefs_err(sb, "Invalid GID feature\n"); zonefs_err(sb, "Invalid GID feature\n");
goto unmap; goto free_page;
} }
} }
...@@ -1731,14 +1731,12 @@ static int zonefs_read_super(struct super_block *sb) ...@@ -1731,14 +1731,12 @@ static int zonefs_read_super(struct super_block *sb)
if (memchr_inv(super->s_reserved, 0, sizeof(super->s_reserved))) { if (memchr_inv(super->s_reserved, 0, sizeof(super->s_reserved))) {
zonefs_err(sb, "Reserved area is being used\n"); zonefs_err(sb, "Reserved area is being used\n");
goto unmap; goto free_page;
} }
import_uuid(&sbi->s_uuid, super->s_uuid); import_uuid(&sbi->s_uuid, super->s_uuid);
ret = 0; ret = 0;
unmap:
kunmap(page);
free_page: free_page:
__free_page(page); __free_page(page);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment