xfs
[Top] [All Lists]

Re: DMAPI dm_set_region

To: "Dean Roehrich" <roehrich@xxxxxxx>
Subject: Re: DMAPI dm_set_region
From: "Francis Qu" <francis@xxxxxxxxxxxx>
Date: Thu, 21 Mar 2002 15:33:54 -0500
Cc: "Linux XFS" <linux-xfs@xxxxxxxxxxx>
References: <200203212003.OAA12756@slobber.americas.sgi.com>
Sender: owner-linux-xfs@xxxxxxxxxxx
Hi Dean,

1. A piece of test code is as below:

  ...

  int i, n;
  int fd;

  fd = open(argv[1], O_WRONLY);
  if (fd == -1) {
    perror("open file failed");
    return 0;
  }

  for (i = 0; i < 100; ++i) {
    n = write(fd, &i, sizeof(i));
    if (n == -1) {
      perror("write error");
      break;
    }

    printf("write %d bytes: %d\n", n, i);
  }

  close(fd);

  ...

2. It doesn't work in such case as:
$ cat >> filename

Thanks,
Francis

----- Original Message -----
From: "Dean Roehrich" <roehrich@xxxxxxx>
To: "Francis Qu" <francis@xxxxxxxxxxxx>
Cc: <linux-xfs@xxxxxxxxxxx>
Sent: Thursday, March 21, 2002 3:03 PM
Subject: Re: DMAPI dm_set_region


>
> >From:  "Francis Qu" <francis@xxxxxxxxxxxx>
> >When DMAPI application tries to do dm_set_region on a file which is
opened for
> > write, both DMAPI application and the user application doing the write
operat
> >ion are blocked. The DMAPI application won't come back from dm_set_region
util
> >l the user cancels the write job.
>
> What are you using to hold the file open?  It is just an open(O_RDWR), or
are
> you also currently in a write(2) or do you currently have it mmaped?  If
> mmapped, is it private or shared?
>
> Can you give me a small C test program to hold the file open in a way
which
> allows this behavior to be seen?
>
> > Is it the way DMAPI works?
>
> Doesn't sound like desirable behavior :)
>
> Dean


<Prev in Thread] Current Thread [Next in Thread>