[bug report] shmem: prepare huge= mount option and sysfs knob

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

 



Hello Kirill A. Shutemov,

The patch 5a6e75f8110c: "shmem: prepare huge= mount option and sysfs
knob" from Jul 26, 2016, leads to the following static checker
warning:

	mm/shmem.c:4013 shmem_init()
	warn: assigning (-2) to unsigned variable 'SHMEM_SB(shm_mnt->mnt_sb)->huge'

mm/shmem.c
  4012  #ifdef CONFIG_TRANSPARENT_HUGE_PAGECACHE
  4013          if (has_transparent_hugepage() && shmem_huge < SHMEM_HUGE_DENY)
  4014                  SHMEM_SB(shm_mnt->mnt_sb)->huge = shmem_huge;


SHMEM_HUGE_DENY is -1 so the value less than that is SHMEM_HUGE_FORCE (-2).

  4015          else
  4016                  shmem_huge = 0; /* just in case it was patched */
  4017  #endif
  4018          return 0;

Btw, if shmem_parse_huge() returns SHMEM_HUGE_FORCE, then both callers
treat that as an error.  The handling for SHMEM_HUGE_FORCE is confusing
for my tiny brain.

regards,
dan carpenter

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux