propagating file change attr on getattr
This commit is contained in:
parent
63f499c4b7
commit
3def6f5e24
3 changed files with 19 additions and 4 deletions
|
|
@ -104,6 +104,7 @@ static int handle_getattr(nfs41_upcall *upcall)
|
||||||
switch (args->query_class) {
|
switch (args->query_class) {
|
||||||
case FileBasicInformation:
|
case FileBasicInformation:
|
||||||
nfs_to_basic_info(&info, &args->basic_info);
|
nfs_to_basic_info(&info, &args->basic_info);
|
||||||
|
args->ctime = info.change;
|
||||||
break;
|
break;
|
||||||
case FileStandardInformation:
|
case FileStandardInformation:
|
||||||
nfs_to_standard_info(&info, &args->std_info);
|
nfs_to_standard_info(&info, &args->std_info);
|
||||||
|
|
@ -165,6 +166,8 @@ static int marshall_getattr(unsigned char *buffer, uint32_t *length, nfs41_upcal
|
||||||
status = 103;
|
status = 103;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
status = safe_write(&buffer, length, &args->ctime, sizeof(args->ctime));
|
||||||
|
if (status) goto out;
|
||||||
out:
|
out:
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,7 @@ typedef struct __getattr_upcall_args {
|
||||||
int query_class;
|
int query_class;
|
||||||
int buf_len;
|
int buf_len;
|
||||||
int query_reply_len;
|
int query_reply_len;
|
||||||
|
ULONGLONG ctime;
|
||||||
} getattr_upcall_args;
|
} getattr_upcall_args;
|
||||||
|
|
||||||
typedef struct __setattr_upcall_args {
|
typedef struct __setattr_upcall_args {
|
||||||
|
|
|
||||||
|
|
@ -194,6 +194,7 @@ typedef struct _updowncall_entry {
|
||||||
BOOLEAN initial_query;
|
BOOLEAN initial_query;
|
||||||
PMDL mdl;
|
PMDL mdl;
|
||||||
PVOID mdl_buf;
|
PVOID mdl_buf;
|
||||||
|
ULONGLONG ChangeTime;
|
||||||
} QueryFile;
|
} QueryFile;
|
||||||
struct {
|
struct {
|
||||||
PUNICODE_STRING filename;
|
PUNICODE_STRING filename;
|
||||||
|
|
@ -1636,13 +1637,24 @@ void unmarshal_nfs41_attrget(
|
||||||
{
|
{
|
||||||
ULONG buf_len;
|
ULONG buf_len;
|
||||||
RtlCopyMemory(&buf_len, *buf, sizeof(ULONG));
|
RtlCopyMemory(&buf_len, *buf, sizeof(ULONG));
|
||||||
*buf += sizeof(ULONG);
|
|
||||||
*attr_len = buf_len;
|
|
||||||
if (buf_len > *attr_len) {
|
if (buf_len > *attr_len) {
|
||||||
cur->status = STATUS_BUFFER_TOO_SMALL;
|
cur->status = STATUS_BUFFER_TOO_SMALL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
*buf += sizeof(ULONG);
|
||||||
|
*attr_len = buf_len;
|
||||||
RtlCopyMemory(attr_value, *buf, buf_len);
|
RtlCopyMemory(attr_value, *buf, buf_len);
|
||||||
|
*buf += buf_len;
|
||||||
|
}
|
||||||
|
|
||||||
|
void unmarshal_nfs41_getattr(
|
||||||
|
nfs41_updowncall_entry *cur,
|
||||||
|
unsigned char **buf)
|
||||||
|
{
|
||||||
|
unmarshal_nfs41_attrget(cur, cur->u.QueryFile.buf,
|
||||||
|
&cur->u.QueryFile.buf_len, buf);
|
||||||
|
RtlCopyMemory(&cur->u.QueryFile.ChangeTime, *buf, sizeof(LONGLONG));
|
||||||
|
DbgP("[getattr] ChangeTime %llu\n", cur->u.QueryFile.ChangeTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS unmarshal_nfs41_getacl(
|
NTSTATUS unmarshal_nfs41_getacl(
|
||||||
|
|
@ -1772,8 +1784,7 @@ NTSTATUS nfs41_downcall(
|
||||||
status = unmarshal_nfs41_dirquery(cur, &buf);
|
status = unmarshal_nfs41_dirquery(cur, &buf);
|
||||||
break;
|
break;
|
||||||
case NFS41_FILE_QUERY:
|
case NFS41_FILE_QUERY:
|
||||||
unmarshal_nfs41_attrget(cur, cur->u.QueryFile.buf,
|
unmarshal_nfs41_getattr(cur, &buf);
|
||||||
&cur->u.QueryFile.buf_len, &buf);
|
|
||||||
break;
|
break;
|
||||||
case NFS41_EA_GET:
|
case NFS41_EA_GET:
|
||||||
unmarshal_nfs41_attrget(cur, cur->u.QueryEa.buf,
|
unmarshal_nfs41_attrget(cur, cur->u.QueryEa.buf,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue