[PATCH v2 026/113] fs: fix unreaddir, so readdir returns unread dirent first

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



unreaddir should return a directory entry at the top of the list, so
readdir consumes it again, not at the end.

Fixes: 7876018f7333 ("fs: implement unreaddir")
Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 fs/fs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fs.c b/fs/fs.c
index b3eac2e55ad6..bd2f0b6294ff 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -1024,7 +1024,7 @@ int unreaddir(DIR *dir, const struct dirent *d)
 
 	entry = xzalloc(sizeof(*entry));
 	entry->d = *d;
-	list_add_tail(&entry->list, &dir->entries);
+	list_add(&entry->list, &dir->entries);
 
 	return 0;
 }
-- 
2.39.2





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux