Whamcloud - gitweb
file loop-sync-2.4.21-suse.patch was initially added on branch b1_2_smallfix.
[fs/lustre-release.git] / lustre / kernel_patches / patches / cifs_2.6.5.patch
1 #EJF i took out part of this change set
2
3
4 # This is a BitKeeper generated diff -Nru style patch.
5 #
6 # ChangeSet
7 #   2004/01/30 17:20:19-06:00 stevef@stevef95.austin.ibm.com 
8 #   Relax requested CIFS permissions on open to simply request GENERIC_READ and GENERIC_WRITE (instead of GENERIC_ALL which
9 #   can unnecessarily conflict with share permissions by asking implicitly for take ownership and other unneeded flags)
10
11 # fs/cifs/dir.c
12 #   2004/01/30 17:20:13-06:00 stevef@stevef95.austin.ibm.com +7 -3
13 #   Relax requested CIFS permissions on open to simply request GENERIC_READ and GENERIC_WRITE (instead of GENERIC_ALL which
14 #   can unnecessarily conflict with share permissions by asking implicitly for take ownership and other unneeded flags)
15
16 # fs/cifs/file.c
17 #   2004/01/30 17:20:13-06:00 stevef@stevef95.austin.ibm.com +12 -4
18 #   Relax requested CIFS permissions on open to simply request GENERIC_READ and GENERIC_WRITE (instead of GENERIC_ALL which
19 #   can unnecessarily conflict with share permissions by asking implicitly for take ownership and other unneeded flags)
20
21 diff -Nru a/fs/cifs/dir.c b/fs/cifs/dir.c
22 --- a/fs/cifs/dir.c     Mon May  3 16:32:08 2004
23 +++ b/fs/cifs/dir.c     Mon May  3 16:32:08 2004
24 @@ -125,7 +125,7 @@
25         int rc = -ENOENT;
26         int xid;
27         int oplock = 0;
28 -       int desiredAccess = GENERIC_ALL;
29 +       int desiredAccess = GENERIC_READ | GENERIC_WRITE;
30         __u16 fileHandle;
31         struct cifs_sb_info *cifs_sb;
32         struct cifsTconInfo *pTcon;
33 @@ -150,8 +150,12 @@
34                         desiredAccess = GENERIC_READ;
35                 else if ((nd->intent.open.flags & O_ACCMODE) == O_WRONLY)
36                         desiredAccess = GENERIC_WRITE;
37 -               else if ((nd->intent.open.flags & O_ACCMODE) == O_RDWR)
38 -                       desiredAccess = GENERIC_ALL;
39 +               else if ((nd->intent.open.flags & O_ACCMODE) == O_RDWR) {
40 +                       /* GENERIC_ALL is too much permission to request */
41 +                       /* can cause unnecessary access denied on create */
42 +                       /* desiredAccess = GENERIC_ALL; */
43 +                       desiredAccess = GENERIC_READ | GENERIC_WRITE;
44 +               }
45  
46                 if((nd->intent.open.flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))
47                         disposition = FILE_CREATE;
48 diff -Nru a/fs/cifs/file.c b/fs/cifs/file.c
49 --- a/fs/cifs/file.c    Mon May  3 16:32:08 2004
50 +++ b/fs/cifs/file.c    Mon May  3 16:32:08 2004
51 @@ -87,8 +87,12 @@
52                 desiredAccess = GENERIC_READ;
53         else if ((file->f_flags & O_ACCMODE) == O_WRONLY)
54                 desiredAccess = GENERIC_WRITE;
55 -       else if ((file->f_flags & O_ACCMODE) == O_RDWR)
56 -               desiredAccess = GENERIC_ALL;
57 +       else if ((file->f_flags & O_ACCMODE) == O_RDWR) {
58 +               /* GENERIC_ALL is too much permission to request */
59 +               /* can cause unnecessary access denied on create */
60 +               /* desiredAccess = GENERIC_ALL; */
61 +               desiredAccess = GENERIC_READ | GENERIC_WRITE;
62 +       }
63  
64  /*********************************************************************
65   *  open flag mapping table: