Hidetoshi Seto
890ecd3d30
btrfs: fix d_off in the first dirent
commit 3765fefaee2da83f10829fa64a74e6b7360350cb upstream.
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>
Cc: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 11:41:03 -07:00
..
2011-05-22 12:33:42 -04:00
2010-05-25 10:34:58 -04:00
2009-10-05 09:44:45 -04:00
2011-05-28 07:00:39 -04:00
2009-01-06 09:38:55 -05:00
2011-05-22 12:33:42 -04:00
2011-05-02 13:57:19 +02:00
2011-06-10 12:14:12 +02:00
2011-07-08 23:25:45 -07:00
2011-06-27 11:34:27 -04:00
2011-06-27 11:34:27 -04:00
2011-05-06 12:34:10 +02:00
2011-05-06 12:34:03 +02:00
2011-05-23 14:37:47 -04:00
2011-06-17 14:54:18 -04:00
2011-05-22 12:33:42 -04:00
2011-05-21 09:27:38 -04:00
2008-09-25 11:04:06 -04:00
2011-06-05 06:17:23 +09:00
2011-06-10 18:57:10 -04:00
2011-05-02 13:57:21 +02:00
2011-05-02 13:57:21 +02:00
2011-08-29 13:29:08 -07:00
2011-05-23 14:37:47 -04:00
2011-06-04 08:11:22 -04:00
2011-06-25 09:31:06 -04:00
2011-05-06 12:34:03 +02:00
2009-06-10 11:29:53 -04:00
2011-05-23 13:24:39 -04:00
2011-06-04 08:11:22 -04:00
2011-04-25 16:46:11 +08:00
2011-10-03 11:41:03 -07:00
2011-06-15 13:24:46 -04:00
2011-05-26 17:52:15 -04:00
2010-12-22 23:15:47 +08:00
2011-05-06 12:34:03 +02:00
2011-05-06 12:34:03 +02:00
2011-02-16 15:37:58 -05:00
2011-05-23 06:30:52 -04:00
2011-03-28 05:37:33 -04:00
2010-12-22 23:15:45 +08:00
2010-12-09 13:57:15 -05:00
2011-01-28 16:40:37 -05:00
2008-09-25 11:03:56 -04:00
2011-05-06 12:34:03 +02:00
2011-05-06 12:34:03 +02:00
2011-06-20 08:58:53 -07:00
2011-05-23 14:37:47 -04:00
2011-06-10 14:59:52 +02:00
2009-01-05 21:25:51 -05:00
2011-07-08 23:25:45 -07:00
2011-06-17 14:54:18 -04:00
2011-06-17 16:38:47 -04:00
2011-05-28 07:00:39 -04:00
2011-05-02 13:57:22 +02:00
2011-08-29 13:29:09 -07:00
2011-05-04 14:01:26 +02:00
2008-09-25 15:41:59 -04:00
2011-08-29 13:29:08 -07:00
2011-08-29 13:29:08 -07:00
2011-05-28 07:00:39 -04:00
2011-02-01 11:12:29 -05:00
2011-03-22 17:44:17 -07:00