From: Chuck Lever Date: Fri, 20 Oct 2006 06:28:41 +0000 (-0700) Subject: [PATCH] NFS: fix minor bug in new NFS symlink code X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=39cf8a1374dc51fea169190674d5e4996a7d7ea2;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git [PATCH] NFS: fix minor bug in new NFS symlink code The original code confused a zero return code from pagevec_add() as success. Test plan: None. Signed-off-by: Chuck Lever Signed-off-by: Trond Myklebust Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 58d44057813e..c86a1ead4772 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -1519,8 +1519,8 @@ static int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *sym pagevec_init(&lru_pvec, 0); if (!add_to_page_cache(page, dentry->d_inode->i_mapping, 0, GFP_KERNEL)) { - if (!pagevec_add(&lru_pvec, page)) - __pagevec_lru_add(&lru_pvec); + pagevec_add(&lru_pvec, page); + pagevec_lru_add(&lru_pvec); SetPageUptodate(page); unlock_page(page); } else