public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] register_filesystem() must return -EEXIST if the filesystem with the same name is already registered
@ 2005-11-02  8:42 Hareesh Nagarajan
  2005-11-02  9:06 ` Coywolf Qi Hunt
  0 siblings, 1 reply; 4+ messages in thread
From: Hareesh Nagarajan @ 2005-11-02  8:42 UTC (permalink / raw)
  To: Linux Kernel Development; +Cc: akpm

[-- Attachment #1: Type: text/plain, Size: 468 bytes --]

If we have a look at the register_filesystem() function defined in 
fs/filesystems.c, we see that if a filesystem with a same name has 
already been registered then the find_filesystem() function will return 
NON-NULL otherwise it will return NULL.

Hence, register_filesystem() should return EEXIST instead of EBUSY. 
Returning EBUSY is misleading (unless of course I'm missing something 
obvious) to the caller of register_filesystem().

Thanks,

Hareesh Nagarajan


[-- Attachment #2: err-register-filesystem.patch --]
[-- Type: text/x-patch, Size: 334 bytes --]

--- linux-2.6.13.4/fs/filesystems.c	2005-10-10 13:54:29.000000000 -0500
+++ linux-2.6.13.4-edit/fs/filesystems.c	2005-11-02 02:33:30.685600000 -0600
@@ -76,7 +76,7 @@
 	write_lock(&file_systems_lock);
 	p = find_filesystem(fs->name);
 	if (*p)
-		res = -EBUSY;
+		res = -EEXIST;
 	else
 		*p = fs;
 	write_unlock(&file_systems_lock);

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

* Re: [PATCH] register_filesystem() must return -EEXIST if the filesystem with the same name is already registered
  2005-11-02  8:42 [PATCH] register_filesystem() must return -EEXIST if the filesystem with the same name is already registered Hareesh Nagarajan
@ 2005-11-02  9:06 ` Coywolf Qi Hunt
  2005-11-02  9:12   ` Coywolf Qi Hunt
  2005-11-02 17:37   ` Hareesh Nagarajan
  0 siblings, 2 replies; 4+ messages in thread
From: Coywolf Qi Hunt @ 2005-11-02  9:06 UTC (permalink / raw)
  To: Hareesh Nagarajan; +Cc: Linux Kernel Development, akpm

On Wed, Nov 02, 2005 at 02:42:12AM -0600, Hareesh Nagarajan wrote:
> If we have a look at the register_filesystem() function defined in 
> fs/filesystems.c, we see that if a filesystem with a same name has 
> already been registered then the find_filesystem() function will return 
> NON-NULL otherwise it will return NULL.
> 
> Hence, register_filesystem() should return EEXIST instead of EBUSY. 
> Returning EBUSY is misleading (unless of course I'm missing something 
> obvious) to the caller of register_filesystem().

This `slot' is buy, so EBUSY makes sense. Filesytem is not file, hence
EEXIST doesn't apply IMHO.

		Coywolf

> 
> Thanks,
> 
> Hareesh Nagarajan
> 

> --- linux-2.6.13.4/fs/filesystems.c	2005-10-10 13:54:29.000000000 -0500
> +++ linux-2.6.13.4-edit/fs/filesystems.c	2005-11-02 02:33:30.685600000 -0600
> @@ -76,7 +76,7 @@
>  	write_lock(&file_systems_lock);
>  	p = find_filesystem(fs->name);
>  	if (*p)
> -		res = -EBUSY;
> +		res = -EEXIST;
>  	else
>  		*p = fs;
>  	write_unlock(&file_systems_lock);


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

* Re: [PATCH] register_filesystem() must return -EEXIST if the filesystem with the same name is already registered
  2005-11-02  9:06 ` Coywolf Qi Hunt
@ 2005-11-02  9:12   ` Coywolf Qi Hunt
  2005-11-02 17:37   ` Hareesh Nagarajan
  1 sibling, 0 replies; 4+ messages in thread
From: Coywolf Qi Hunt @ 2005-11-02  9:12 UTC (permalink / raw)
  To: Hareesh Nagarajan; +Cc: Linux Kernel Development, akpm

On Wed, Nov 02, 2005 at 05:06:56PM +0800, Coywolf Qi Hunt wrote:
> On Wed, Nov 02, 2005 at 02:42:12AM -0600, Hareesh Nagarajan wrote:
> > If we have a look at the register_filesystem() function defined in 
> > fs/filesystems.c, we see that if a filesystem with a same name has 
> > already been registered then the find_filesystem() function will return 
> > NON-NULL otherwise it will return NULL.
> > 
> > Hence, register_filesystem() should return EEXIST instead of EBUSY. 
> > Returning EBUSY is misleading (unless of course I'm missing something 
> > obvious) to the caller of register_filesystem().
> 
> This `slot' is buy, so EBUSY makes sense. Filesytem is not file, hence

s/buy/busy/

> EEXIST doesn't apply IMHO.
> 
> 		Coywolf
> 
> > 
> > Thanks,
> > 
> > Hareesh Nagarajan
> > 
> 
> > --- linux-2.6.13.4/fs/filesystems.c	2005-10-10 13:54:29.000000000 -0500
> > +++ linux-2.6.13.4-edit/fs/filesystems.c	2005-11-02 02:33:30.685600000 -0600
> > @@ -76,7 +76,7 @@
> >  	write_lock(&file_systems_lock);
> >  	p = find_filesystem(fs->name);
> >  	if (*p)
> > -		res = -EBUSY;
> > +		res = -EEXIST;
> >  	else
> >  		*p = fs;
> >  	write_unlock(&file_systems_lock);

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

* Re: [PATCH] register_filesystem() must return -EEXIST if the filesystem with the same name is already registered
  2005-11-02  9:06 ` Coywolf Qi Hunt
  2005-11-02  9:12   ` Coywolf Qi Hunt
@ 2005-11-02 17:37   ` Hareesh Nagarajan
  1 sibling, 0 replies; 4+ messages in thread
From: Hareesh Nagarajan @ 2005-11-02 17:37 UTC (permalink / raw)
  To: Coywolf Qi Hunt; +Cc: Linux Kernel Development, akpm

Coywolf Qi Hunt wrote:
> On Wed, Nov 02, 2005 at 02:42:12AM -0600, Hareesh Nagarajan wrote:
>> If we have a look at the register_filesystem() function defined in 
>> fs/filesystems.c, we see that if a filesystem with a same name has 
>> already been registered then the find_filesystem() function will return 
>> NON-NULL otherwise it will return NULL.
>>
>> Hence, register_filesystem() should return EEXIST instead of EBUSY. 
>> Returning EBUSY is misleading (unless of course I'm missing something 
>> obvious) to the caller of register_filesystem().
> 
> This `slot' is buy, so EBUSY makes sense. Filesytem is not file, hence
> EEXIST doesn't apply IMHO.

Earlier this week, my calls to register_filesystem(struct 
file_system_type * fs) were failing returning an -EBUSY. Now I didn't 
know if it was failing because of:
	if (fs->next)	return -EBUSY;
Or:
	p = find_filesystem(fs->name);
         if (*p)	res = -EBUSY;
	...
	return res;

It is for this reason I thought it would make sense to differentiate 
between the two points of failure.

Hareesh Nagarajan

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

end of thread, other threads:[~2005-11-02 17:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-02  8:42 [PATCH] register_filesystem() must return -EEXIST if the filesystem with the same name is already registered Hareesh Nagarajan
2005-11-02  9:06 ` Coywolf Qi Hunt
2005-11-02  9:12   ` Coywolf Qi Hunt
2005-11-02 17:37   ` Hareesh Nagarajan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox