public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [BUG ?] smbfs open always succeeds
@ 2004-11-29 11:11 tvrtko.ursulin
  0 siblings, 0 replies; 8+ messages in thread
From: tvrtko.ursulin @ 2004-11-29 11:11 UTC (permalink / raw)
  To: linux-kernel; +Cc: torvalds, akpm, marcelo.tosatti

Hello,

I posted a possible bug report to the maintainer about 10 days ago but 
with no response, therefore here it goes again. As far a I can tell it is 
common for both 2.4 and 2.6.

Sorry if this is not a bug but some hidden functionality!

--- snippet from the original mail to the maintainer ---

Looking at linux-2.6.9/fs/smbfs/file.c line 365 (end of the smb_file_open 
function). Shouldn't it be "return result;" instead of "return 0;" ?

I've been tracing some strange behaviour and this fixed it for me. But I 
am far away from being an expert. :)



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

* Re: [BUG ?] smbfs open always succeeds
@ 2004-11-30 15:19 tvrtko.ursulin
  2004-11-30 15:43 ` Linus Torvalds
  0 siblings, 1 reply; 8+ messages in thread
From: tvrtko.ursulin @ 2004-11-30 15:19 UTC (permalink / raw)
  To: akpm, linux-kernel, marcelo.tosatti, torvalds

>I posted a possible bug report to the maintainer about 10 days ago but
>with no response, therefore here it goes again. As far a I can tell it is
>common for both 2.4 and 2.6.
>
>Sorry if this is not a bug but some hidden functionality!
>
>--- snippet from the original mail to the maintainer ---
>
>Looking at linux-2.6.9/fs/smbfs/file.c line 365 (end of the smb_file_open
>function). Shouldn't it be "return result;" instead of "return 0;" ?
>
>I've been tracing some strange behaviour and this fixed it for me. But I
>am far away from being an expert. :)

I investigated a bit and found a nfs_open function at 
linux-2.6.9/fs/nfs/inode.c line 906 which also always returns 0. So is 
this a network filesystem way of handling opens and not a bug after all? I 
am not sure though that both nfs and smbfs operate in the same way and am 
not claiming that.


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

* Re: [BUG ?] smbfs open always succeeds
  2004-11-30 15:19 tvrtko.ursulin
@ 2004-11-30 15:43 ` Linus Torvalds
  0 siblings, 0 replies; 8+ messages in thread
From: Linus Torvalds @ 2004-11-30 15:43 UTC (permalink / raw)
  To: tvrtko.ursulin; +Cc: Andrew Morton, Kernel Mailing List, marcelo.tosatti, urban



On Tue, 30 Nov 2004 tvrtko.ursulin@sophos.com wrote:
> 
> I investigated a bit and found a nfs_open function at 
> linux-2.6.9/fs/nfs/inode.c line 906 which also always returns 0. So is 
> this a network filesystem way of handling opens and not a bug after all? I 
> am not sure though that both nfs and smbfs operate in the same way and am 
> not claiming that.

Many networked filesystems end up doing most of the _real_ permissions
checking at IO time, not opens. That said, "open()" should return
definitive errors as early as possible, but sometimes you really have the
case that the real error only happens when you try to read or write
something.

Not saying that smbfs is right, just explaining that it _might_ be right. 

Urban, did you see the thread?

		Linus

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

* Re: [BUG ?] smbfs open always succeeds
@ 2004-12-08 16:33 tvrtko.ursulin
  2004-12-08 21:32 ` Marcelo Tosatti
  0 siblings, 1 reply; 8+ messages in thread
From: tvrtko.ursulin @ 2004-12-08 16:33 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, Kernel Mailing List, marcelo.tosatti, urban

>Not saying that smbfs is right, just explaining that it _might_ be right.
>
>Urban, did you see the thread?

Urban seems to be MIA. Or on a long holiday. :) What shall we do?



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

* Re: [BUG ?] smbfs open always succeeds
  2004-12-08 16:33 [BUG ?] smbfs open always succeeds tvrtko.ursulin
@ 2004-12-08 21:32 ` Marcelo Tosatti
  0 siblings, 0 replies; 8+ messages in thread
From: Marcelo Tosatti @ 2004-12-08 21:32 UTC (permalink / raw)
  To: tvrtko.ursulin; +Cc: Linus Torvalds, Andrew Morton, Kernel Mailing List, urban

On Wed, Dec 08, 2004 at 04:33:56PM +0000, tvrtko.ursulin@sophos.com wrote:
> >Not saying that smbfs is right, just explaining that it _might_ be right.
> >
> >Urban, did you see the thread?
> 
> Urban seems to be MIA. Or on a long holiday. :) What shall we do?

It seems Andrew applied this to the -mm tree. 

smb_file_open-retval-fix.patch

From: <tvrtko.ursulin@sophos.com>

Correctly propagate the return value from smb_open().

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/smbfs/file.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN fs/smbfs/file.c~smb_file_open-retval-fix fs/smbfs/file.c
--- 25/fs/smbfs/file.c~smb_file_open-retval-fix Mon Nov 29 13:08:30 2004
+++ 25-akpm/fs/smbfs/file.c     Mon Nov 29 13:08:38 2004
@@ -363,7 +363,7 @@ smb_file_open(struct inode *inode, struc
        SMB_I(inode)->openers++;
 out:
        unlock_kernel();
-       return 0;
+       return result;
 }



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

* Re: [BUG ?] smbfs open always succeeds
@ 2004-12-10 11:06 tvrtko.ursulin
  2004-12-11 21:24 ` Marcelo Tosatti
  0 siblings, 1 reply; 8+ messages in thread
From: tvrtko.ursulin @ 2004-12-10 11:06 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: Andrew Morton, Kernel Mailing List, Linus Torvalds, urban

>It seems Andrew applied this to the -mm tree.
>
>smb_file_open-retval-fix.patch

Hm, I guess I should have spotted that but unfortunately I don't have 
enough time to keep up with mm lately. :I

Marcelo, are you planning to put it in 2.4 ?



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

* Re: [BUG ?] smbfs open always succeeds
  2004-12-10 11:06 tvrtko.ursulin
@ 2004-12-11 21:24 ` Marcelo Tosatti
  2004-12-12  0:20   ` Gene Heskett
  0 siblings, 1 reply; 8+ messages in thread
From: Marcelo Tosatti @ 2004-12-11 21:24 UTC (permalink / raw)
  To: tvrtko.ursulin; +Cc: Andrew Morton, Kernel Mailing List, Linus Torvalds, urban

On Fri, Dec 10, 2004 at 11:06:42AM +0000, tvrtko.ursulin@sophos.com wrote:
> >It seems Andrew applied this to the -mm tree.
> >
> >smb_file_open-retval-fix.patch
> 
> Hm, I guess I should have spotted that but unfortunately I don't have 
> enough time to keep up with mm lately. :I
> 
> Marcelo, are you planning to put it in 2.4 ?

After it has been present in a major v2.6 release (v2.6.11) for a few months
to guarantee there are no negative side effects, yes.

Written to my whiteboard as a remainder, my memory is quite bad. :) 


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

* Re: [BUG ?] smbfs open always succeeds
  2004-12-11 21:24 ` Marcelo Tosatti
@ 2004-12-12  0:20   ` Gene Heskett
  0 siblings, 0 replies; 8+ messages in thread
From: Gene Heskett @ 2004-12-12  0:20 UTC (permalink / raw)
  To: linux-kernel

On Saturday 11 December 2004 16:24, Marcelo Tosatti wrote:

>Written to my whiteboard as a remainder, my memory is quite bad. :)

Marcelo, thats supposed to be my line!  My wet ram is at least 50
years older than yours.   :-)

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
99.30% setiathome rank, not too shabby for a WV hillbilly
Yahoo.com attorneys please note, additions to this message
by Gene Heskett are:
Copyright 2004 by Maurice Eugene Heskett, all rights reserved.


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

end of thread, other threads:[~2004-12-12  0:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-08 16:33 [BUG ?] smbfs open always succeeds tvrtko.ursulin
2004-12-08 21:32 ` Marcelo Tosatti
  -- strict thread matches above, loose matches on Subject: below --
2004-12-10 11:06 tvrtko.ursulin
2004-12-11 21:24 ` Marcelo Tosatti
2004-12-12  0:20   ` Gene Heskett
2004-11-30 15:19 tvrtko.ursulin
2004-11-30 15:43 ` Linus Torvalds
2004-11-29 11:11 tvrtko.ursulin

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