Re: [PATCH v2] selftests/mount: Close 'fd' when write fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 25/02/23 09:51AM, Ritvik Gupta wrote:
> Yes, the kernel will handle the 'fd' cleanup automatically, but
> the existing implementation already closes it before exiting.
> However, in case where write fails, its unhandled.
> This patch addresses that gap :)
> 
> Nevertheless it's subjective indeed.
> Thanks for reviewing!
> 
> Regards
> Ritvik

The current implementation doesn't close the fd before calling
the die() function. It only closes fd before returning because
vmaybe_write_file() doesn't necessarily exit the process. It
only exits in failure cases, including failures when closing
the file itself. I think the close() failure path might have
caused some confusion.

Cheers,
Seyediman




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux