linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] problems with alloc_file_pseudo() use in __nfs42_ssc_open()
@ 2022-08-17 21:55 Al Viro
  2022-08-17 22:32 ` Olga Kornievskaia
  0 siblings, 1 reply; 14+ messages in thread
From: Al Viro @ 2022-08-17 21:55 UTC (permalink / raw)
  To: linux-nfs; +Cc: Olga Kornievskaia, linux-fsdevel

	My apologies for having missed that back when the SSC
patchset had been done (and missing the problems after it got
merged, actually).

1) if this
        r_ino = nfs_fhget(ss_mnt->mnt_sb, src_fh, fattr);
in __nfs42_ssc_open() yields a directory inode, we are screwed
as soon as it's passed to alloc_file_pseudo() - a *lot* of places
in dcache handling would break if we do that.  It's not too
nice for a regular file from non-cooperating filesystem, but for
directory ones it's deadly.

2) if alloc_file_pseudo() fails there, we get an inode leak.  It
needs an iput() for that case.  As in
        if (IS_ERR(filep)) {
		res = ERR_CAST(filep);
		iput(r_ino);
		goto out_free_name;
	}

But I'd like to point out that alloc_file_pseudo() is not inteded for
use on normal filesystem's inodes - the use here *mostly* works
(directories aside), but...  Use it on filesystem with non-trivial
default dentry_operations and things will get interesting, etc.

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

end of thread, other threads:[~2022-08-19 18:19 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-17 21:55 [RFC] problems with alloc_file_pseudo() use in __nfs42_ssc_open() Al Viro
2022-08-17 22:32 ` Olga Kornievskaia
2022-08-18  0:01   ` Al Viro
2022-08-18  0:12     ` Olga Kornievskaia
2022-08-18  0:20       ` Al Viro
2022-08-18  5:19       ` Amir Goldstein
2022-08-18  5:52         ` Al Viro
2022-08-18 13:13           ` Olga Kornievskaia
2022-08-18 14:38             ` Trond Myklebust
2022-08-19  2:51             ` dai.ngo
2022-08-19 14:22               ` Olga Kornievskaia
2022-08-19 15:42                 ` dai.ngo
2022-08-19 17:37                   ` Olga Kornievskaia
2022-08-19 18:18                     ` dai.ngo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).