Linux-Fsdevel Archive on lore.kernel.org
help / color / mirror / Atom feed
* Re: [PATCH] exfat: call brelse() on error path
@ 2020-06-10 12:07 Markus Elfring
  2020-06-10 17:22 ` [PATCH v2] exfat: add missing brelse() calls on error paths Dan Carpenter
  0 siblings, 1 reply; 11+ messages in thread
From: Markus Elfring @ 2020-06-10 12:07 UTC (permalink / raw)
  To: Dan Carpenter, linux-fsdevel
  Cc: kernel-janitors, linux-kernel, Namjae Jeon, Sungjong Seo,
	Pali Rohár, Tetsuhiro Kohada, Wei Yongjun

> If the second exfat_get_dentry() call fails then we need to release
> "old_bh" before returning.

Thanks you picked a bit of information up from my source code analysis
for a possible adjustment of the function “exfat_rename_file”.

exfat: Improving exception handling in two functions
https://lore.kernel.org/linux-fsdevel/208cba7b-e535-c8e0-5ac7-f15170117a7f@web.de/
https://lkml.org/lkml/2020/6/10/272

Would you like to adjust the implementation of the function “exfat_move_file”
in a similar way in a subsequent patch variant?

Regards,
Markus

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: exfat: Improving exception handling in two functions
@ 2020-06-10  9:27 Markus Elfring
  2020-06-10  9:59 ` [PATCH] exfat: call brelse() on error path Dan Carpenter
  0 siblings, 1 reply; 11+ messages in thread
From: Markus Elfring @ 2020-06-10  9:27 UTC (permalink / raw)
  To: linux-fsdevel, Namjae Jeon, Sungjong Seo
  Cc: kernel-janitors, linux-kernel, Dan Carpenter, Pali Rohár,
	Tetsuhiro Kohada, Wei Yongjun

Hello,

I have taken another look at pointer usage after calls of the function “brelse”.
My source code analysis approach pointed implementation details
like the following out for further software development considerations.
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/fs/exfat/namei.c?id=3d155ae4358baf4831609c2f9cd09396a2b8badf#n1078

…
		epold = exfat_get_dentry(sb, p_dir, oldentry + 1, &old_bh,
			&sector_old);
		epnew = exfat_get_dentry(sb, p_dir, newentry + 1, &new_bh,
			&sector_new);
		if (!epold || !epnew)
			return -EIO;
…

I suggest to split such an error check.
How do you think about to release a buffer head object for the desired
exception handling if one of these function calls succeeded?

Would you like to adjust such code in the functions “exfat_rename_file”
and “exfat_move_file”?

Regards,
Markus

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-06-11  8:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-10 12:07 [PATCH] exfat: call brelse() on error path Markus Elfring
2020-06-10 17:22 ` [PATCH v2] exfat: add missing brelse() calls on error paths Dan Carpenter
2020-06-10 18:12   ` Markus Elfring
2020-06-10 18:45     ` Dan Carpenter
2020-06-10 18:56       ` Markus Elfring
2020-06-10 19:22         ` Matthew Wilcox
2020-06-10 20:00           ` Markus Elfring
2020-06-11  3:41   ` [PATCH v2] " Namjae Jeon
2020-06-11  8:00   ` Markus Elfring
2020-06-11  8:40   ` Markus Elfring
  -- strict thread matches above, loose matches on Subject: below --
2020-06-10  9:27 exfat: Improving exception handling in two functions Markus Elfring
2020-06-10  9:59 ` [PATCH] exfat: call brelse() on error path Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).