Showing error 1592

User: Jiri Slaby
Error type: Leaving function in locked state
Error type description: Some lock is not unlocked on all paths of a function, so it is leaked
File location: fs/xfs/linux-2.6/xfs_lrw.c
Line in file: 199
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-05-29 20:11:37 UTC


Source:

169ssize_t                        /* bytes read, or (-)  error */
170xfs_read(
171        xfs_inode_t                *ip,
172        struct kiocb                *iocb,
173        const struct iovec        *iovp,
174        unsigned int                segs,
175        loff_t                        *offset,
176        int                        ioflags)
177{
178        struct file                *file = iocb->ki_filp;
179        struct inode                *inode = file->f_mapping->host;
180        xfs_mount_t                *mp = ip->i_mount;
181        size_t                        size = 0;
182        ssize_t                        ret = 0;
183        xfs_fsize_t                n;
184        unsigned long                seg;
185
186
187        XFS_STATS_INC(xs_read_calls);
188
189        /* START copy & waste from filemap.c */
190        for (seg = 0; seg < segs; seg++) {
191                const struct iovec *iv = &iovp[seg];
192
193                /*
194                 * If any segment has a negative length, or the cumulative
195                 * length ever wraps negative then return -EINVAL.
196                 */
197                size += iv->iov_len;
198                if (unlikely((ssize_t)(size|iv->iov_len) < 0))
199                        return XFS_ERROR(-EINVAL);
200        }
201        /* END copy & waste from filemap.c */
202
203        if (unlikely(ioflags & IO_ISDIRECT)) {
204                xfs_buftarg_t        *target =
205                        XFS_IS_REALTIME_INODE(ip) ?
206                                mp->m_rtdev_targp : mp->m_ddev_targp;
207                if ((*offset & target->bt_smask) ||
208                    (size & target->bt_smask)) {
209                        if (*offset == ip->i_size) {
Show full sources