Hold writes directed towards the filesystem

Hello All,

I have a problem for which I require to block all the writes (in general
any form of modification) directed towards a volume for a short period.
This volume has open files on it, so essentially it cant be locked using
FSCTL_LOCK_VOLUME. The method that comes to my mind is to implement an
upper layer fs filter driver that would block all the IRPS that can
change the fs state (IRP_MJ_CREATE, IRP_MJ_SETINFORMATION, IRP_MJ_WRITE).
Is there any other better method of doing this ?

thanks
-KJO

Not know of any other way. We have implemented the way you described,
and it works fine.

Max

----- Original Message -----
From: “kjo”
To: “File Systems Developers”
Sent: Monday, May 26, 2003 10:24 AM
Subject: [ntfsd] Hold writes directed towards the filesystem

> Hello All,
>
> I have a problem for which I require to block all the writes (in
general
> any form of modification) directed towards a volume for a short
period.
> This volume has open files on it, so essentially it cant be locked
using
> FSCTL_LOCK_VOLUME. The method that comes to my mind is to implement
an
> upper layer fs filter driver that would block all the IRPS that can
> change the fs state (IRP_MJ_CREATE, IRP_MJ_SETINFORMATION,
IRP_MJ_WRITE).
> Is there any other better method of doing this ?
>
> thanks
> -KJO
>
> —
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

Hello,

Maxim, thanks for your reply.

I have some issues with this approach. To ensure on-disk filesystem
consistecncy, I want to flush the volume using IRP_MJ_FLUSH_BUFFERS. This
will result in recursive IRPs being directed to the filesystem stack. I
want to simply ‘pass-through’ all the IRPs generated as a result of the
flushing operation. I am thinking of using the IRP_PAGING_IO flag to
identify these IRPs and let them go down. However the issues that I face
are:

  1. Is there a good way to identify IO directed towards the page file,
    other than caching the fileobject when the page file is created\opened
    (using SL_OPEN_PAGING_FILE).

  2. Are there any issues in blocking IOs which are a result of the modified
    page writer flushing the pages to disk.

Please let me know your views about this.

Thanks
-KJO

Just send IRP_MJ_FLUSH_BUFFERS by manually creating the IRP to your
lower device, not from the top of the stack. This works in our
product.

Max

----- Original Message -----
From: “kjo”
To: “File Systems Developers”
Sent: Monday, May 26, 2003 4:06 PM
Subject: [ntfsd] Re: Hold writes directed towards the filesystem

> Hello,
>
> Maxim, thanks for your reply.
>
> I have some issues with this approach. To ensure on-disk filesystem
> consistecncy, I want to flush the volume using IRP_MJ_FLUSH_BUFFERS.
This
> will result in recursive IRPs being directed to the filesystem
stack. I
> want to simply ‘pass-through’ all the IRPs generated as a result of
the
> flushing operation. I am thinking of using the IRP_PAGING_IO flag to
> identify these IRPs and let them go down. However the issues that I
face
> are:
>
> 1. Is there a good way to identify IO directed towards the page
file,
> other than caching the fileobject when the page file is
created\opened
> (using SL_OPEN_PAGING_FILE).
>
> 2. Are there any issues in blocking IOs which are a result of the
modified
> page writer flushing the pages to disk.
>
> Please let me know your views about this.
>
> Thanks
> -KJO
>
> —
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com