Selaa lähdekoodia

Btrfs: Fix looping on readdir of the subvol roots

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Yan Zheng 17 vuotta sitten
vanhempi
commit
5e591a0703
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  1. 4 1
      fs/btrfs/inode.c

+ 4 - 1
fs/btrfs/inode.c

@@ -1465,7 +1465,10 @@ read_dir_items:
 			di = (struct btrfs_dir_item *)((char *)di + di_len);
 		}
 	}
-	filp->f_pos = INT_LIMIT(typeof(filp->f_pos));
+	if (key_type == BTRFS_DIR_INDEX_KEY)
+		filp->f_pos = INT_LIMIT(typeof(filp->f_pos));
+	else
+		filp->f_pos++;
 nopos:
 	ret = 0;
 err: