All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 12047/12612] mm/filemap.c:2414 filemap_update_page() warn: inconsistent returns '&mapping->invalidate_lock'.
@ 2021-06-24  9:42 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-06-24  9:42 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 5482 bytes --]

CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Jan Kara <jack@suse.cz>
CC: "Darrick J. Wong" <djwong@kernel.org>
CC: Christoph Hellwig <hch@lst.de>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   d61c8b66c84080ecf8f9f4d9272ab4ec78029a59
commit: 51f5c649d466e517feb071d4dc4de2680450af63 [12047/12612] mm: Protect operations adding pages to page cache with invalidate_lock
:::::: branch date: 21 hours ago
:::::: commit date: 2 days ago
config: x86_64-randconfig-m001-20210622 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
mm/filemap.c:2414 filemap_update_page() warn: inconsistent returns '&mapping->invalidate_lock'.

vim +2414 mm/filemap.c

fce70da3a80fcd Matthew Wilcox (Oracle  2021-02-24  2366) 
4612aeef09ec49 Matthew Wilcox (Oracle  2021-02-24  2367) static int filemap_update_page(struct kiocb *iocb,
4612aeef09ec49 Matthew Wilcox (Oracle  2021-02-24  2368) 		struct address_space *mapping, struct iov_iter *iter,
fce70da3a80fcd Matthew Wilcox (Oracle  2021-02-24  2369) 		struct page *page)
723ef24b9b379e Kent Overstreet         2020-12-14  2370  {
723ef24b9b379e Kent Overstreet         2020-12-14  2371  	int error;
723ef24b9b379e Kent Overstreet         2020-12-14  2372  
51f5c649d466e5 Jan Kara                2021-01-28  2373  	if (iocb->ki_flags & IOCB_NOWAIT) {
51f5c649d466e5 Jan Kara                2021-01-28  2374  		if (!filemap_invalidate_trylock_shared(mapping))
51f5c649d466e5 Jan Kara                2021-01-28  2375  			return -EAGAIN;
51f5c649d466e5 Jan Kara                2021-01-28  2376  	} else {
51f5c649d466e5 Jan Kara                2021-01-28  2377  		filemap_invalidate_lock_shared(mapping);
51f5c649d466e5 Jan Kara                2021-01-28  2378  	}
51f5c649d466e5 Jan Kara                2021-01-28  2379  
bd8a1f3655a704 Matthew Wilcox (Oracle  2021-02-24  2380) 	if (!trylock_page(page)) {
51f5c649d466e5 Jan Kara                2021-01-28  2381  		error = -EAGAIN;
87d1d7b688319a Matthew Wilcox (Oracle  2021-02-24  2382) 		if (iocb->ki_flags & (IOCB_NOWAIT | IOCB_NOIO))
51f5c649d466e5 Jan Kara                2021-01-28  2383  			goto unlock_mapping;
87d1d7b688319a Matthew Wilcox (Oracle  2021-02-24  2384) 		if (!(iocb->ki_flags & IOCB_WAITQ)) {
51f5c649d466e5 Jan Kara                2021-01-28  2385  			filemap_invalidate_unlock_shared(mapping);
bd8a1f3655a704 Matthew Wilcox (Oracle  2021-02-24  2386) 			put_and_wait_on_page_locked(page, TASK_KILLABLE);
4612aeef09ec49 Matthew Wilcox (Oracle  2021-02-24  2387) 			return AOP_TRUNCATED_PAGE;
bd8a1f3655a704 Matthew Wilcox (Oracle  2021-02-24  2388) 		}
87d1d7b688319a Matthew Wilcox (Oracle  2021-02-24  2389) 		error = __lock_page_async(page, iocb->ki_waitq);
87d1d7b688319a Matthew Wilcox (Oracle  2021-02-24  2390) 		if (error)
51f5c649d466e5 Jan Kara                2021-01-28  2391  			goto unlock_mapping;
bd8a1f3655a704 Matthew Wilcox (Oracle  2021-02-24  2392) 	}
ebded02788b5d7 Mel Gorman              2016-03-15  2393  
51f5c649d466e5 Jan Kara                2021-01-28  2394  	error = AOP_TRUNCATED_PAGE;
bd8a1f3655a704 Matthew Wilcox (Oracle  2021-02-24  2395) 	if (!page->mapping)
51f5c649d466e5 Jan Kara                2021-01-28  2396  		goto unlock;
^1da177e4c3f41 Linus Torvalds          2005-04-16  2397  
fce70da3a80fcd Matthew Wilcox (Oracle  2021-02-24  2398) 	error = 0;
fce70da3a80fcd Matthew Wilcox (Oracle  2021-02-24  2399) 	if (filemap_range_uptodate(mapping, iocb->ki_pos, iter, page))
fce70da3a80fcd Matthew Wilcox (Oracle  2021-02-24  2400) 		goto unlock;
fce70da3a80fcd Matthew Wilcox (Oracle  2021-02-24  2401) 
fce70da3a80fcd Matthew Wilcox (Oracle  2021-02-24  2402) 	error = -EAGAIN;
fce70da3a80fcd Matthew Wilcox (Oracle  2021-02-24  2403) 	if (iocb->ki_flags & (IOCB_NOIO | IOCB_NOWAIT | IOCB_WAITQ))
fce70da3a80fcd Matthew Wilcox (Oracle  2021-02-24  2404) 		goto unlock;
fce70da3a80fcd Matthew Wilcox (Oracle  2021-02-24  2405) 
68430303c84e1f Matthew Wilcox (Oracle  2021-02-24  2406) 	error = filemap_read_page(iocb->ki_filp, mapping, page);
51f5c649d466e5 Jan Kara                2021-01-28  2407  	goto unlock_mapping;
fce70da3a80fcd Matthew Wilcox (Oracle  2021-02-24  2408) unlock:
fce70da3a80fcd Matthew Wilcox (Oracle  2021-02-24  2409) 	unlock_page(page);
51f5c649d466e5 Jan Kara                2021-01-28  2410  unlock_mapping:
51f5c649d466e5 Jan Kara                2021-01-28  2411  	filemap_invalidate_unlock_shared(mapping);
51f5c649d466e5 Jan Kara                2021-01-28  2412  	if (error == AOP_TRUNCATED_PAGE)
51f5c649d466e5 Jan Kara                2021-01-28  2413  		put_page(page);
fce70da3a80fcd Matthew Wilcox (Oracle  2021-02-24 @2414) 	return error;
^1da177e4c3f41 Linus Torvalds          2005-04-16  2415  }
^1da177e4c3f41 Linus Torvalds          2005-04-16  2416  

:::::: The code at line 2414 was first introduced by commit
:::::: fce70da3a80fcd0a9c0192dedd6bf86a43845ac9 mm/filemap: add filemap_range_uptodate

:::::: TO: Matthew Wilcox (Oracle) <willy@infradead.org>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 50273 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-24  9:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-24  9:42 [linux-next:master 12047/12612] mm/filemap.c:2414 filemap_update_page() warn: inconsistent returns '&mapping->invalidate_lock' kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.