Re: [axboe-block:for-6.5/block] [block] 1ccf164ec8: WARNING:at_mm/gup.c:#try_get_folio

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

 



This reproduces the problem.  It can probably be simplified still further.

Make a UDF filesystem and mount it:

	fallocate /mnt2/udf_scratch -l 1G
	mount -o loop /mnt2/udf_scratch /xfstests.scratch
	./the_program_below /xfstests.scratch/foo

David
---
#define __USE_GNU
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <err.h>
# define O_DIRECT      040000

static char buf[256 * 1024] __attribute__((aligned(512)));
static char *filename;

static void cleanup(void)
{
	if (unlink(filename) == -1)
		err(1, "unlink");
}

int main(int argc, char **argv)
{
	size_t page = 4096, big = 2 * page;
	int fd;

	if (argc != 2) {
		fprintf(stderr, "Format: %s <file>\n", argv[1]);
		exit(2);
	}

	filename = argv[1];

	fd = open(filename, O_RDWR | O_CREAT | O_EXCL, 0666);
	if (fd == -1)
		err(1, "%s", filename);

	atexit(cleanup);

	if (pwrite(fd, buf, page, 0) != page)
		err(1, "pwrite/1");

	if (pwrite(fd, buf, big, big) != big)
		err(1, "pwrite/2");

	if (close(fd) == -1)
		err(1, "close");

	fd = open(filename, O_RDWR | O_DIRECT);
	if (fd == -1)
		err(1, "%s", filename);

	if (pread(fd, buf, big, big) != big)
		err(1, "pread/1");

	if (pread(fd, buf, big, 0) != big)
		err(1, "pread/2");

	if (pwrite(fd, buf, big, 0) != big)
		err(1, "pwrite/3");

	if (close(fd) == -1)
		err(1, "close");

	return 0;
}




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux