Possible data race on file->f_ra.ra_pages between generic_fadvise() and force_page_cache_readahead()

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

 



Hi VFS developers,

There might exists cases where file->f_ra.ra_pages may race in
generic_fadvise() and force_page_cache_readahead().

Following is the execution trace

[Setup]
create("file_bar", 511) = 3;

[Thread 1]
fadvise64(3, 9055, 975, 2);
ksys_fadvise64_64
  vfs_fadvise
    generic_fadvise
      [WRITE] file->f_ra.ra_pages = bdi->ra_pages;

[Thread 2]
fadvise64(3, 9374, 3618, 3);
ksys_fadvise64_64
  vfs_fadvise
    generic_fadvise
      force_page_cache_readahead
        [READ] max_pages = max_t(unsigned long, bdi->io_pages, ra->ra_pages);

I could confirm dynamically that the order between [READ] and [WRITE]
is not deterministic (i.e., either may go first). However, they do not
lead to any crash or panics so I guess this might not be a serious
issue.

But just in case there may be unintended consequences, I am posting
this issue here for more visibility. Feel free to comment and discuss.

Best Regards,
Meng



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux