From: Sage Weil Date: Mon, 7 Apr 2008 13:36:31 +0000 (-0700) Subject: kclient: linux seems to treat an illegal combinatino of O_RDWR, O_WRONLY and O_RDONLY... X-Git-Tag: v0.3~239^2~81^2^2~10^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ad150d5fb7e7144d12a3bf26cea2d284da3a9122;p=ceph.git kclient: linux seems to treat an illegal combinatino of O_RDWR, O_WRONLY and O_RDONLY as O_RDWR, strangely --- diff --git a/src/kernel/super.h b/src/kernel/super.h index 771ac082ef7..cbf22bccd84 100644 --- a/src/kernel/super.h +++ b/src/kernel/super.h @@ -290,9 +290,7 @@ static inline int ceph_file_mode(int flags) return FILE_MODE_WRONLY; if ((flags & O_ACCMODE) == O_RDONLY) return FILE_MODE_RDONLY; - BUG_ON(1); - - return 0; /* remove compilation warning */ + return FILE_MODE_RDWR; /* not -EINVAL under Linux, strangely */ } static inline struct ceph_client *ceph_inode_to_client(struct inode *inode)