All of lore.kernel.org
 help / color / mirror / Atom feed
* + hfs-add-missing-clean-up-in-hfs_fill_super.patch added to -mm tree
@ 2021-07-10 21:45 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2021-07-10 21:45 UTC (permalink / raw)
  To: mm-commits, viro, slava, skhan, gustavoars, gregkh, desmondcheongzx


The patch titled
     Subject: hfs: add missing clean-up in hfs_fill_super
has been added to the -mm tree.  Its filename is
     hfs-add-missing-clean-up-in-hfs_fill_super.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/hfs-add-missing-clean-up-in-hfs_fill_super.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/hfs-add-missing-clean-up-in-hfs_fill_super.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
Subject: hfs: add missing clean-up in hfs_fill_super

Before exiting hfs_fill_super, the struct hfs_find_data used in
hfs_find_init should be passed to hfs_find_exit to be cleaned up, and to
release the lock held on the btree.

The call to hfs_find_exit is missing from an error path.  We add it back
in by consolidating calls to hfs_find_exit for error paths.

Link: https://lkml.kernel.org/r/20210701030756.58760-2-desmondcheongzx@gmail.com
Signed-off-by: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>
Cc: Gustavo A. R. Silva <gustavoars@kernel.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Shuah Khan <skhan@linuxfoundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/hfs/super.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- a/fs/hfs/super.c~hfs-add-missing-clean-up-in-hfs_fill_super
+++ a/fs/hfs/super.c
@@ -420,14 +420,12 @@ static int hfs_fill_super(struct super_b
 	if (!res) {
 		if (fd.entrylength > sizeof(rec) || fd.entrylength < 0) {
 			res =  -EIO;
-			goto bail;
+			goto bail_hfs_find;
 		}
 		hfs_bnode_read(fd.bnode, &rec, fd.entryoffset, fd.entrylength);
 	}
-	if (res) {
-		hfs_find_exit(&fd);
-		goto bail_no_root;
-	}
+	if (res)
+		goto bail_hfs_find;
 	res = -EINVAL;
 	root_inode = hfs_iget(sb, &fd.search_key->cat, &rec);
 	hfs_find_exit(&fd);
@@ -443,6 +441,8 @@ static int hfs_fill_super(struct super_b
 	/* everything's okay */
 	return 0;
 
+bail_hfs_find:
+	hfs_find_exit(&fd);
 bail_no_root:
 	pr_err("get root inode failed\n");
 bail:
_

Patches currently in -mm which might be from desmondcheongzx@gmail.com are

hfs-add-missing-clean-up-in-hfs_fill_super.patch
hfs-fix-high-memory-mapping-in-hfs_bnode_read.patch
hfs-add-lock-nesting-notation-to-hfs_find_init.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-10 21:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-10 21:45 + hfs-add-missing-clean-up-in-hfs_fill_super.patch added to -mm tree akpm

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.