All of lore.kernel.org
 help / color / mirror / Atom feed
* NFSv4: cinfo->atomic and file creation
@ 2017-06-09 18:04 Chuck Lever
  2017-08-18 16:39 ` Trond Myklebust
  0 siblings, 1 reply; 4+ messages in thread
From: Chuck Lever @ 2017-06-09 18:04 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: Linux NFS Mailing List

Hi Trond-

As we discussed yesterday, I'm concerned about the test in
_nfs4_proc_open that uses the values of the cinfo.before and
cinfo.after fields without checking cinfo.atomic.

2288         if (o_arg->open_flags & O_CREAT) {
2289                 if (o_arg->open_flags & O_EXCL)
2290                         data->file_created = 1;
2291                 else if (o_res->cinfo.before != o_res->cinfo.after)
2292                         data->file_created = 1;
2293                 if (data->file_created || dir->i_version != o_res->cinfo.after)
2294                         update_changeattr(dir, &o_res->cinfo,
2295                                         o_res->f_attr->time_start);
2296         }

Line 2291 is the issue.

Suppose the server filesystem substitutes a weak ctime for
the change attribute. Sometimes when a file is successfully
created on the server, the ctime of the parent doesn't
change. This test then fails and leaves file_created set
to zero.

Later, nfs4_opendata_access looks at file_created. If not
set, the access check fails and open(2) returns EACCES as
a result, even though the file was created successfully
and OPEN returned NFS4_OK.

You mentioned that the server should set cinfo.atomic to
be false when a weak ctime is used as the change attribute.
Will that help in this case?


--
Chuck Lever




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-18 17:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-09 18:04 NFSv4: cinfo->atomic and file creation Chuck Lever
2017-08-18 16:39 ` Trond Myklebust
2017-08-18 16:53   ` Chuck Lever
2017-08-18 17:51     ` Trond Myklebust

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.