@@ -453,12 +453,16 @@ static loff_t ext4_seek_data(struct file *file, loff_t offset, loff_t maxsize)
loff_t dataoff, isize;
int blkbits;
int ret = 0;
+ unsigned long count = 0;
mutex_lock(&inode->i_mutex);
isize = i_size_read(inode);
+ pr_info("%s(): isize: %llx, offset: %llx, maxsize: %llx\n",
+ __func__, isize, offset, maxsize);
if (offset >= isize) {
mutex_unlock(&inode->i_mutex);
+ pr_info("%s() returns -ENXIO(offset is too large)\n", __func__);
return -ENXIO;
}
@@ -467,8 +471,11 @@ static loff_t ext4_seek_data(struct file *file, loff_t offset, loff_t maxsize)
last = start;
end = isize >> blkbits;
dataoff = offset;
+ pr_info("%s(): blkbits: %d, start: %x, end: %x\n",
+ __func__, blkbits, start, end);
do {
+ count++;
map.m_lblk = last;
map.m_len = end - last + 1;
ret = ext4_map_blocks(NULL, inode, &map, 0);
@@ -508,8 +515,12 @@ static loff_t ext4_seek_data(struct file *file, loff_t offset, loff_t maxsize)
mutex_unlock(&inode->i_mutex);
- if (dataoff > isize)
+ pr_info("%s(): loop count: %ld\n", __func__, count);
+
+ if (dataoff > isize) {
+ pr_info("%s() returns -ENXIO\n", __func__);
return -ENXIO;
+ }
return vfs_setpos(file, dataoff, maxsize);
}