Re: [PATCH 4/4 for 5.15 stable] btrfs: fix race between reading a directory and adding entries to it

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

 



On Thu, Jan 25, 2024 at 11:59:38AM +0000, fdmanana@xxxxxxxxxx wrote:
> From: Filipe Manana <fdmanana@xxxxxxxx>
> 
> commit 8e7f82deb0c0386a03b62e30082574347f8b57d5 upstream.
> 
> When opening a directory (opendir(3)) or rewinding it (rewinddir(3)), we
> are not holding the directory's inode locked, and this can result in later
> attempting to add two entries to the directory with the same index number,
> resulting in a transaction abort, with -EEXIST (-17), when inserting the
> second delayed dir index. This results in a trace like the following:

[..]

> Fixes: 9b378f6ad48c ("btrfs: fix infinite directory reads")
> CC: stable@xxxxxxxxxxxxxxx # 6.5+
> Signed-off-by: Filipe Manana <fdmanana@xxxxxxxx>
> Reviewed-by: David Sterba <dsterba@xxxxxxxx>
> Signed-off-by: David Sterba <dsterba@xxxxxxxx>

Based on https://lore.kernel.org/stable/20240126185534.GA2668448@lxhi-087:

Reviewed-by: Eugeniu Rosca <eugeniu.rosca@xxxxxxxxx>




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux