Re: [PATCH] dcache: return -ESTALE not -EBUSY on distributed fs race

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 19, 2014 at 12:50:38AM +0900, J. R. Okajima wrote:
> 
> "J. Bruce Fields":
> > It's still kind of a bandaid, but it's the only thing I've thought of
> > that at least helps a little and isn't a huge pain.  Any other ideas?
> 
> How about introducing a tiny inline function which returns either EBUSY
> or ESTALE?
> 
> static inline int busy_or_stale()
> {
> 	if (!test_distributed_fs())
> 		return -EBUSY;
> 	return -ESTALE;
> }

Why do you think -EBUSY's the right error in the local filesystem case?

This condition really shouldn't happen in the local filesystem case
anyway.  If anything maybe it should be -EIO, since it looks like a sign
your filesystem's corrupted.

> For nfs, the test function will be something like this.
> 
> int test_nfsd()
> {
> 	int ret;
> 	struct task_struct *tsk = current;
> 	char comm[sizeof(tsk->comm)];
> 
> 	ret = 0;
> 	if (tsk->flags & PF_KTHREAD) {
> 		get_task_comm(comm, tsk);
> 		ret = !strcmp(comm, "nfsd");
> 	}
> 
> 	return ret;
> }
> 
> I know this "by-name" test is not good.

Also you'd want to be checking for nfs, not nfsd.

--b.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux