Hidetoshi Seto 3765fefaee btrfs: fix d_off in the first dirent
Since the d_off in the first dirent for "." (that originates from
the 4th argument "offset" of filldir() for the 2nd dirent for "..")
is wrongly assigned in btrfs_real_readdir(), telldir returns same
offset for different locations.

 | # mkfs.btrfs /dev/sdb1
 | # mount /dev/sdb1 fs0
 | # cd fs0
 | # touch file0 file1
 | # ../test
 | telldir: 0
 | readdir: d_off = 2, d_name = "."
 | telldir: 2
 | readdir: d_off = 2, d_name = ".."
 | telldir: 2
 | readdir: d_off = 3, d_name = "file0"
 | telldir: 3
 | readdir: d_off = 2147483647, d_name = "file1"
 | telldir: 2147483647

To fix this problem, pass filp->f_pos (which is loff_t) instead.

 | # ../test
 | telldir: 0
 | readdir: d_off = 1, d_name = "."
 | telldir: 1
 | readdir: d_off = 2, d_name = ".."
 | telldir: 2
 | readdir: d_off = 3, d_name = "file0"
 :

At the moment the "offset" for "." is unused because there is no
preceding dirent, however it is better to pass filp->f_pos to follow
grammatical usage.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2011-09-18 10:20:46 -04:00
..
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-05-19 16:55:28 +09:30
2011-03-10 08:52:07 +01:00
2011-07-17 23:20:29 -04:00
2011-06-06 09:51:52 -04:00
2011-06-03 18:24:58 -04:00
2011-06-20 17:53:24 -05:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-06-03 18:24:58 -04:00
2011-01-07 17:50:26 +11:00
2011-03-10 08:52:07 +01:00
2011-04-14 16:06:56 -07:00
2011-07-17 23:21:35 -04:00
2011-07-06 12:15:16 -07:00
2010-10-29 04:16:28 -04:00
2011-03-31 11:26:23 -03:00
2011-03-21 00:16:08 -04:00
2011-07-06 10:41:13 -07:00
2011-05-26 10:01:43 -06:00
2011-03-21 01:10:41 -04:00
2011-01-07 17:50:33 +11:00
2011-05-23 19:58:53 +02:00
2011-03-14 09:15:28 -04:00
2011-06-03 18:24:58 -04:00