From: Anthony Doggett <Anthony2486-fDpYTK8McCxDP812hmKXO1pr/1R2p/CL@public.gmane.org>
To: Vyacheslav Dubeyko <slava-yeENwD64cLxBDgjK7y7TUQ@public.gmane.org>
Cc: linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: mkfs.nilfs2 -b 1024 -B 8192
Date: Tue, 9 Apr 2013 22:08:27 +0100 [thread overview]
Message-ID: <20130409210827.GA3809@grill.lan> (raw)
In-Reply-To: <424816AD-A79B-4F3D-A886-8D0CC735812B-yeENwD64cLxBDgjK7y7TUQ@public.gmane.org>
Hi Vyacheslav
I've been curious as to what within the "darcs whatsnew" was causing the
"nilfs_direct_assign: invalid pointer: 0" / "broken bmap" issue for 1kB
blocks and I had a quiet half hour today, so I've boiled it down to a
simpler script and a short bit of C. I include both below just in case
you should find them useful. I was surprised to see that the 'a' makes
it to the file despite the filesystem errors.
Kind regards,
Anthony
Script:
VG=unencrypted
gcc -Wall truncate_mmap.c
#lvcreate --size 2G --name ntest $VG
mkfs.nilfs2 -b 1024 -B 8192 /dev/mapper/$VG-ntest
mkdir /var/tmp/n
mkdir /var/tmp/n/ntest
mount /dev/mapper/$VG-ntest /var/tmp/n/ntest
cd /var/tmp/n/ntest
sleep 2
date
dmesg|tail -n 5
$OLDPWD/a.out
date
sleep 8
dmesg|tail -n 5
truncate_mmap.c:
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <unistd.h>
#define handle_error(msg) \
do { perror(msg); exit(EXIT_FAILURE); } while (0)
int main()
{
char *addr;
int fd;
int t;
int c;
size_t size = 60;
fd = open("truncate_mmap.tst", O_RDWR|O_CREAT|O_NOCTTY);
if (fd == -1)
handle_error("open");
t = ftruncate(fd, (off_t) size);
if (t != 0)
handle_error("ftruncate");
addr = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
if (addr == MAP_FAILED)
handle_error("mmap");
addr[0] = 'a';
c = close(fd);
if (c != 0)
handle_error("close");
exit(EXIT_SUCCESS);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-04-09 21:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-13 7:14 mkfs.nilfs2 -b 1024 -B 8192 Anthony Doggett
[not found] ` <20130313071453.GA17072-P/DK4avwC2n/PtFMR13I2A@public.gmane.org>
2013-03-13 8:25 ` Vyacheslav Dubeyko
2013-03-13 14:27 ` Anthony Doggett
[not found] ` <20130313142726.GA3328-9gBkq9fxGAp+urZeOPWqwQ@public.gmane.org>
2013-03-14 6:40 ` Vyacheslav Dubeyko
2013-03-14 18:14 ` Vyacheslav Dubeyko
[not found] ` <424816AD-A79B-4F3D-A886-8D0CC735812B-yeENwD64cLxBDgjK7y7TUQ@public.gmane.org>
2013-04-09 21:08 ` Anthony Doggett [this message]
[not found] ` <20130409210827.GA3809-P/DK4avwC2n/PtFMR13I2A@public.gmane.org>
2013-04-10 6:19 ` Vyacheslav Dubeyko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130409210827.GA3809@grill.lan \
--to=anthony2486-fdpytk8mccxdp812hmkxo1pr/1r2p/cl@public.gmane.org \
--cc=linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=slava-yeENwD64cLxBDgjK7y7TUQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.