Re: [PATCH v3 1/2] fs: avoid fdput() after failed fdget() in ksys_sync_file_range()

From: Luis Chamberlain
Date: Fri May 15 2020 - 12:12:19 EST


On Wed, May 13, 2020 at 05:33:20PM -0600, Shuah Khan wrote:
> Fix ksys_sync_file_range() to avoid fdput() after a failed fdget().
> fdput() doesn't do fput() on this file since FDPUT_FPUT isn't set
> in fd.flags.
>
> Change it anyway since failed fdget() doesn't require a fdput(). Refine
> the code path a bit for it to read more clearly.
> Reference: 22f96b3808c1 ("fs: add sync_file_range() helper")
>
> Signed-off-by: Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>

Reviewed-by: Luis Chamberlain <mcgrof@xxxxxxxxxx>

Luis