Skip to content

Commit a9e9b7b

Browse files
spuiuksmfrench
authored andcommitted
cifs: Do not take a reference to the page in cifs_readpage_worker()
We do not need to take a reference to the pagecache in cifs_readpage_worker() since the calling function will have already taken one before passing the pointer to the page as an argument to the function. Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <smfrench@gmail.com>
1 parent bdbdfde commit a9e9b7b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/cifs/file.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3379,6 +3379,9 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
33793379
return rc;
33803380
}
33813381

3382+
/*
3383+
* cifs_readpage_worker must be called with the page pinned
3384+
*/
33823385
static int cifs_readpage_worker(struct file *file, struct page *page,
33833386
loff_t *poffset)
33843387
{
@@ -3390,7 +3393,6 @@ static int cifs_readpage_worker(struct file *file, struct page *page,
33903393
if (rc == 0)
33913394
goto read_complete;
33923395

3393-
page_cache_get(page);
33943396
read_data = kmap(page);
33953397
/* for reads over a certain size could initiate async read ahead */
33963398

@@ -3417,7 +3419,6 @@ static int cifs_readpage_worker(struct file *file, struct page *page,
34173419

34183420
io_error:
34193421
kunmap(page);
3420-
page_cache_release(page);
34213422

34223423
read_complete:
34233424
return rc;

0 commit comments

Comments
 (0)