Showing error 1326

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/direct-io.c
Line in file: 1220
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-05-21 20:30:05 UTC


Source:

1190                                mutex_unlock(&inode->i_mutex);
1191                                acquire_i_mutex = 1;
1192                        }
1193                }
1194
1195                if (dio_lock_type == DIO_LOCKING)
1196                        /* lockdep: not the owner will release it */
1197                        down_read_non_owner(&inode->i_alloc_sem);
1198        }
1199
1200        /*
1201         * For file extending writes updating i_size before data
1202         * writeouts complete can expose uninitialized blocks. So
1203         * even for AIO, we need to wait for i/o to complete before
1204         * returning in this case.
1205         */
1206        dio->is_async = !is_sync_kiocb(iocb) && !((rw & WRITE) &&
1207                (end > i_size_read(inode)));
1208
1209        retval = direct_io_worker(rw, iocb, inode, iov, offset,
1210                                nr_segs, blkbits, get_block, end_io, dio);
1211
1212        if (rw == READ && dio_lock_type == DIO_LOCKING)
1213                release_i_mutex = 0;
1214
1215out:
1216        if (release_i_mutex)
1217                mutex_unlock(&inode->i_mutex);
1218        else if (acquire_i_mutex)
1219                mutex_lock(&inode->i_mutex);
1220        return retval;
1221}
1222EXPORT_SYMBOL(__blockdev_direct_IO);
Show full sources