On Wednesday 03 of December 2008, Dave Chinner wrote:
> On Wed, Dec 03, 2008 at 10:42:29PM +0100, Arkadiusz Miskiewicz wrote:
> > On Wednesday 03 of December 2008, Dave Chinner wrote:
> > [arekm@farm rpm]$ touch /home/users/arekm/tmp/aa
> > [arekm@farm rpm]$ ./a.out
> > ret=-1 Invalid cross-device link
>
> Well, that's what we needed to know. The bug:
>
> 199 /*
> 200 * Lock all the participating inodes. Depending upon whether
> 201 * the target_name exists in the target directory, and
> 202 * whether the target directory is the same as the source
> 203 * directory, we can lock from 2 to 4 inodes.
> 204 */
> 205 >>>>> xfs_lock_inodes(inodes, num_inodes, XFS_ILOCK_EXCL);
> 206
> 207 /*
> 208 * If we are using project inheritance, we only allow renames
> 209 * into our tree when the project IDs are the same; else the
> 210 * tree quota mechanism would be circumvented.
> 211 */
> 212 if (unlikely((target_dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT)
> && 213 (target_dp->i_d.di_projid !=
> src_ip->i_d.di_projid))) { 214 error = XFS_ERROR(EXDEV);
> 215 >>>>>>> xfs_rename_unlock4(inodes, XFS_ILOCK_SHARED);
> 216 xfs_trans_cancel(tp, cancel_flags);
> 217 goto std_return;
> 218 }
>
> Is that the unlock of the inodes is using the incorrect lock
> type for the unlock, (inodes lock XFS_ILOCK_EXCL, unlocked
> XFS_ILOCK_SHARED) which means they don't get unlocked and the next attempt
> to do anything with those inodes will hang.
>
> Compile-tested-only patch below that should fix the problem.
It fixes the problem for me. Thanks! I hope that it will reach stable@ team
for 2.6.27.9.
> Cheers,
>
> Dave.
--
Arkadiusz MiÅkiewicz PLD/Linux Team
arekm / maven.pl http://ftp.pld-linux.org/
|