[PATCH 2/8] xfs: Fix open flag handling in open_by_handle code

Christoph Hellwig hch at infradead.org
Fri Mar 2 01:47:44 CST 2012


>  	/* Put open permission in namei format. */

this coment is obsolete now.

>  	permflag = hreq->oflags;
> -	if ((permflag+1) & O_ACCMODE)
> -		permflag++;
> -	if (permflag & O_TRUNC)
> -		permflag |= 2;
> -
>  	if ((!(permflag & O_APPEND) || (permflag & O_TRUNC)) &&
> -	    (permflag & FMODE_WRITE) && IS_APPEND(inode)) {
> +	    (OPEN_FMODE(permflag) & FMODE_WRITE) && IS_APPEND(inode)) {

It would seem cleaner to still keep a loca fmode_t fmode variable
instead of using OPEN_FMODE multiple times.



More information about the xfs mailing list