[Bugs] [Bug 1465075] Fd based fops fail with EBADF on file migration

bugzilla at redhat.com bugzilla at redhat.com
Mon Jul 10 04:14:03 UTC 2017


https://bugzilla.redhat.com/show_bug.cgi?id=1465075



--- Comment #9 from Nithya Balachandran <nbalacha at redhat.com> ---
There is yet another race between the cached subvol being updated in the
inode_ctx and the fd being opened on the target.


1. fop1 -> fd1 -> subvol0
2. file migrated from subvol0 to subvol1 and cached_subvol changed to subvol1
in inode_ctx
3. fop2 -> fd1 -> subvol1 [takes new cached subvol]
4. fop2 -> checks fd ctx (fd not open on subvol1) -> opens fd1 on subvol1
5. fop1 -> checks fd ctx (fd not open on subvol0) -> tries to open fd1 on
subvol0 -> fails with "No such file on directory".


Possible fixes:

1. Keep track of all fds opened on all subvols in a list. This will also help
fix the fd leaks that are currently present.

2. If dht_fd_open_on_dst fails with ENOENT, check if the cached subvol in the
inode_ctx has changed. If yes, wind to the new cached subvol.

3.  If dht_fd_open_on_dst fails with ENOENT, wind to old subvol and let the
phase1/phase2 checks handle it.


Option 3 is probably the safest at this point as the phase1/phase2 checks will
kick in.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=4rnvzOVAGs&a=cc_unsubscribe


More information about the Bugs mailing list