On Thu, 18 Jul 2024 10:29:50 +0800 Xiao Ni <xni@xxxxxxxxxx> wrote: > > lseek64 errors are unusual, they are exceptional, and I'm fine with logging > > same error message but I would prefer to avoid repeating same message in > > code. In case of debug, developer can do some backtracking, starting from > > this function rather than hunt for the particular error message you used > > multiple times. > > Hi Mariusz > > If we use the above way, pr_err only prints the line of code in the > function lseek64_log_err. We can't know where the error is. pr_err > prints the function name and code line number. We put pr_err in the > place where lseek fails, we can know which function and which lseek > fails. It should be easy for debug. Is it right? > > Oh right, I forgot about this from simple reason - I'm never using this. Line is printed with make CXFLAGS=DDEBUG. If you will enable DEBUG flag then mdadm will also spam with debug messages (prr_dbg messages). Anyway, you are right it is an option. Enabling DDEBUG in the past many times broke my time sensitive reproductions. I don't like it.