Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
ceph: fix file mode calculation

+10 -7
+10 -7
net/ceph/ceph_fs.c
··· 36 36 if ((flags & O_DIRECTORY) == O_DIRECTORY) 37 37 return CEPH_FILE_MODE_PIN; 38 38 #endif 39 - if ((flags & O_APPEND) == O_APPEND) 40 - flags |= O_WRONLY; 41 39 42 - if ((flags & O_ACCMODE) == O_RDWR) 43 - mode = CEPH_FILE_MODE_RDWR; 44 - else if ((flags & O_ACCMODE) == O_WRONLY) 40 + switch (flags & O_ACCMODE) { 41 + case O_WRONLY: 45 42 mode = CEPH_FILE_MODE_WR; 46 - else 43 + break; 44 + case O_RDONLY: 47 45 mode = CEPH_FILE_MODE_RD; 48 - 46 + break; 47 + case O_RDWR: 48 + case O_ACCMODE: /* this is what the VFS does */ 49 + mode = CEPH_FILE_MODE_RDWR; 50 + break; 51 + } 49 52 #ifdef O_LAZY 50 53 if (flags & O_LAZY) 51 54 mode |= CEPH_FILE_MODE_LAZY;