Please sign in to comment.
mm, fadvise: don't return -EINVAL when filesystem cannot implement fa…
…dvise() Eric Wong reported his test suite failex when /tmp is tmpfs. https://lkml.org/lkml/2012/2/24/479 Currentlt the input check of POSIX_FADV_WILLNEED has two problems. - requires a_ops->readpage. But in fact, force_page_cache_readahead() requires that the target filesystem has either ->readpage or ->readpages. - returns -EINVAL when the filesystem doesn't have ->readpage. But posix says that fadvise is merely a hint. Thus fadvise() should return 0 if filesystem has no means of implementing fadvise(). The userland application should not know nor care whcih type of filesystem backs the TMPDIR directory, as Eric pointed out. There is nothing which userspace can do to solve this error. So change the return value to 0 when filesytem doesn't support readahead. [firstname.lastname@example.org: checkpatch fixes] Signed-off-by: KOSAKI Motohiro <email@example.com> Cc: Hugh Dickins <firstname.lastname@example.org> Cc: Hillf Danton <email@example.com> Signed-off-by: Eric Wong <firstname.lastname@example.org> Tested-by: Eric Wong <email@example.com> Reviewed-by: Wanlong Gao <firstname.lastname@example.org> Signed-off-by: Andrew Morton <email@example.com> Signed-off-by: Linus Torvalds <firstname.lastname@example.org>
- Loading branch information...