Problems with Quota manager on Win2k3R2

Hello!

I am having some problems with Microsoft quota manager in Windows 2003 R2.
My legacy filter stores some metadata in extended attributes (EAs) on
the first file/directory open (in post IRP_MJ_CREATE).
In normal operation EAs are added on file create. If files were
created on a filesystem before my filter was attached (before the
installation) then EAs are appended when the file is first seen by the
filter.
After enabling the Quota Management tool in File Server Resource
Manager (FRSM) I ran into some problems in quota exceeded situation.

The problem occurs if a file without EAs is opened in quota exceeded
situation or a new file is created and there is just one allocation
unit of free quota. In both cases the filter tries to write EAs to a
file (in post open - file is already opened) but the issued
IRP_MJ_SET_EA failes with an error STATUS_DISK_FULL (0xC000007F).
Since I cannot write EAs I cancel the file open and return the disk
full error to userspace.

After the Microsoft quota manager (QM) fails the EA write it tries to
open the file (on which it blocked writing) several times for its own
purposes. Each open is intercepted by filter which again tries to
write EAs and the writing again fails with an error STATUS_DISK_FULL.
This “failure” again triggers several file openes (in QM) which are
again blocked by hsmfs etc.
Therefore the system comes into a flood of opens which may run into
low resources problems (CPU usage 100%).

To solve the flood of opens I have some ideas:

  • skip filtering QM actions (no handling)
    Problems:
  • how to determine what I/O belongs to QM - what PID (one of
    svchost.exe processes)
  • can I afford that? what operations are done by QM?
  • can I be sure that the svchost is used just for QM?
  • mark file as “noEAs” in my file context and skip EA writing for
    some time (timeout)

None of them seems to be a clean solution.

Do you have any ideas how to proceed here? Is there a way to determine
“quota left” from the filter? Did anyone notice something like that?

Regards,
Urban

Post it to a worker thread, impersonate, or attach to the system
process. In that way you’ll be running with the system SID so the
operation won’t fail (file systems do not enforce quotas on the system -
down that road lies madness and system instability.)

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Urban Purkat
Sent: Tuesday, June 06, 2006 5:36 AM
To: ntfsd redirect
Subject: [ntfsd] Problems with Quota manager on Win2k3R2

Hello!

I am having some problems with Microsoft quota manager in Windows 2003
R2.
My legacy filter stores some metadata in extended attributes (EAs) on
the first file/directory open (in post IRP_MJ_CREATE).
In normal operation EAs are added on file create. If files were
created on a filesystem before my filter was attached (before the
installation) then EAs are appended when the file is first seen by the
filter.
After enabling the Quota Management tool in File Server Resource
Manager (FRSM) I ran into some problems in quota exceeded situation.

The problem occurs if a file without EAs is opened in quota exceeded
situation or a new file is created and there is just one allocation
unit of free quota. In both cases the filter tries to write EAs to a
file (in post open - file is already opened) but the issued
IRP_MJ_SET_EA failes with an error STATUS_DISK_FULL (0xC000007F).
Since I cannot write EAs I cancel the file open and return the disk
full error to userspace.

After the Microsoft quota manager (QM) fails the EA write it tries to
open the file (on which it blocked writing) several times for its own
purposes. Each open is intercepted by filter which again tries to
write EAs and the writing again fails with an error STATUS_DISK_FULL.
This “failure” again triggers several file openes (in QM) which are
again blocked by hsmfs etc.
Therefore the system comes into a flood of opens which may run into
low resources problems (CPU usage 100%).

To solve the flood of opens I have some ideas:

  • skip filtering QM actions (no handling)
    Problems:
  • how to determine what I/O belongs to QM - what PID (one of
    svchost.exe processes)
  • can I afford that? what operations are done by QM?
  • can I be sure that the svchost is used just for QM?
  • mark file as “noEAs” in my file context and skip EA writing for
    some time (timeout)

None of them seems to be a clean solution.

Do you have any ideas how to proceed here? Is there a way to determine
“quota left” from the filter? Did anyone notice something like that?

Regards,
Urban


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Tony,

Thanks for the answer.

Regards,
Urban