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

Re: DMAPI dm_set_region



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@sgi.com>
To: "Francis Qu" <francis@raidzone.com>
Cc: <linux-xfs@oss.sgi.com>
Sent: Thursday, March 21, 2002 3:03 PM
Subject: Re: DMAPI dm_set_region


>
> >From:  "Francis Qu" <francis@raidzone.com>
> >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