Showing error 1140

User: Jiri Slaby
Error type: Double Lock
Error type description: Some lock is locked twice unintentionally in a sequence
File location: fs/xfs/linux-2.6/xfs_lrw.c
Line in file: 661
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-04-29 14:49:11 UTC


Source:

631                        goto out_unlock_internal;
632                }
633                xfs_ilock(xip, XFS_ILOCK_EXCL);
634                eventsent = 1;
635
636                /*
637                 * The iolock was dropped and reacquired in XFS_SEND_DATA
638                 * so we have to recheck the size when appending.
639                 * We will only "goto start;" once, since having sent the
640                 * event prevents another call to XFS_SEND_DATA, which is
641                 * what allows the size to change in the first place.
642                 */
643                if ((file->f_flags & O_APPEND) && pos != xip->i_size)
644                        goto start;
645        }
646
647        if (ioflags & IO_ISDIRECT) {
648                xfs_buftarg_t        *target =
649                        XFS_IS_REALTIME_INODE(xip) ?
650                                mp->m_rtdev_targp : mp->m_ddev_targp;
651
652                if ((pos & target->bt_smask) || (count & target->bt_smask)) {
653                        xfs_iunlock(xip, XFS_ILOCK_EXCL|iolock);
654                        return XFS_ERROR(-EINVAL);
655                }
656
657                if (!need_i_mutex && (mapping->nrpages || pos > xip->i_size)) {
658                        xfs_iunlock(xip, XFS_ILOCK_EXCL|iolock);
659                        iolock = XFS_IOLOCK_EXCL;
660                        need_i_mutex = 1;
661                        mutex_lock(&inode->i_mutex);
662                        xfs_ilock(xip, XFS_ILOCK_EXCL|iolock);
663                        goto start;
664                }
665        }
666
667        new_size = pos + count;
668        if (new_size > xip->i_size)
669                xip->i_new_size = new_size;
670
671        /*
Show full sources