[Cluster-devel] [PATCH v2] fs: return EPERM on immutable inode

2016-04-05 Thread Eryu Guan
In most cases, EPERM is returned on immutable inode, and there're only a few places returning EACCES. I noticed this when running LTP on overlayfs, setxattr03 failed due to unexpected EACCES on immutable inode. So converting all EACCES to EPERM on immutable inode. Acked-by: Dave Chinner Signed-o

Re: [Cluster-devel] [PATCH] fs: return EPERM on immutable inode

2016-04-05 Thread Dave Chinner
On Tue, Apr 05, 2016 at 09:28:10PM +0800, Eryu Guan wrote: > In most cases, EPERM is returned on immutable inode, and there're only > a few places returning EACCES. And EPERM looks more reasonable to me. > > So converting all EACCES to EPERM on immutable inode. > > Signed-off-by: Eryu Guan > ---

Re: [Cluster-devel] [PATCH 1/2] gfs2_edit: Don't hijack bh->b_data in read_master_dir

2016-04-05 Thread Bob Peterson
- Original Message - > read_master_dir() reads data that doesn't match the bh's metadata into > bh->b_data, which confuses display() later when it checks whether > re-reading the block is required. Use bread() in read_master_dir() > instead to keep the bh consistent, and make sure read_supe

Re: [Cluster-devel] [PATCH 2/2] mkfs.gfs2: Open the target device with O_EXCL

2016-04-05 Thread Bob Peterson
- Original Message - > On 05/04/16 15:14, Bob Peterson wrote: > > In fact, we used to have O_EXCL: > > > > https://git.fedorahosted.org/cgit/cluster.git/commit/gfs2/mkfs/main_mkfs.c?h=RHEL6&id=b0db0bad3e6a8996fcaecbb93bfe9f8de97b7508 > > > > I remember Ryan doing this, but I'm not sure why

Re: [Cluster-devel] [GFS2 PATCH] gfs2: Use gfs2 wrapper to sync inode before calling generic_file_splice_read()

2016-04-05 Thread Bob Peterson
- Original Message - > gfs2_file_splice_read() f_op grabs and releases the cluster-wide > inode glock to sync the inode size to the latest. > > Without this, generic_file_splice_read() uses an older i_size value > and can return EOF for valid offsets in the inode. > > Resolves: rhbz#13007

Re: [Cluster-devel] [PATCH 2/2] mkfs.gfs2: Open the target device with O_EXCL

2016-04-05 Thread Andrew Price
On 05/04/16 15:14, Bob Peterson wrote: In fact, we used to have O_EXCL: https://git.fedorahosted.org/cgit/cluster.git/commit/gfs2/mkfs/main_mkfs.c?h=RHEL6&id=b0db0bad3e6a8996fcaecbb93bfe9f8de97b7508 I remember Ryan doing this, but I'm not sure why or how it disappeared. We need to chase down wh

[Cluster-devel] [PATCH 1/2] gfs2_edit: Don't hijack bh->b_data in read_master_dir

2016-04-05 Thread Andrew Price
read_master_dir() reads data that doesn't match the bh's metadata into bh->b_data, which confuses display() later when it checks whether re-reading the block is required. Use bread() in read_master_dir() instead to keep the bh consistent, and make sure read_superblock() doesn't leak the buffer earl

[Cluster-devel] [PATCH 2/2] mkfs.gfs2: Open the target device with O_EXCL

2016-04-05 Thread Andrew Price
O_EXCL will let local mounters know that the device is busy while mkfs.gfs2 is running so that they don't try to access it. Before: # mount /dev/vdc /mnt/test mount: /dev/vdc: can't read superblock With O_EXCL: # mount /dev/vdc /mnt/test mount: /dev/vdc is already mounted or /mnt/test bus

Re: [Cluster-devel] [PATCH 2/2] mkfs.gfs2: Open the target device with O_EXCL

2016-04-05 Thread Bob Peterson
- Original Message - > O_EXCL will let local mounters know that the device is busy while > mkfs.gfs2 is running so that they don't try to access it. > > Before: > # mount /dev/vdc /mnt/test > mount: /dev/vdc: can't read superblock > > With O_EXCL: > # mount /dev/vdc /mnt/test > mo

[Cluster-devel] [PATCH] fs: return EPERM on immutable inode

2016-04-05 Thread Eryu Guan
In most cases, EPERM is returned on immutable inode, and there're only a few places returning EACCES. And EPERM looks more reasonable to me. So converting all EACCES to EPERM on immutable inode. Signed-off-by: Eryu Guan --- I noticed this when running LTP on overlayfs, setxattr03 failed due to