Re: [Cluster-devel] [PATCH 08/16] gfs2: use is_xxx_kiocb instead of filp-fl_flags

2015-04-07 Thread Steven Whitehouse

Hi,

On 04/04/15 20:13, Dmitry Monakhov wrote:

Cc: cluster-devel@redhat.com
Signed-off-by: Dmitry Monakhov dmonak...@openvz.org

Acked-by: Steven Whitehouse swhit...@redhat.com

Steve.


---
  fs/gfs2/file.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index f6fc412..25da110 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -709,7 +709,7 @@ static ssize_t gfs2_file_write_iter(struct kiocb *iocb, 
struct iov_iter *from)
  
  	gfs2_size_hint(file, iocb-ki_pos, iov_iter_count(from));
  
-	if (file-f_flags  O_APPEND) {

+   if (is_append_kiocb(iocb)) {
struct gfs2_holder gh;
  
  		ret = gfs2_glock_nq_init(ip-i_gl, LM_ST_SHARED, 0, gh);




[Cluster-devel] gfs2-utils 3.1.8 released

2015-04-07 Thread Andrew Price

Hi,

I am happy to announce the 3.1.8 release of gfs2-utils. This release 
includes the following visible changes:


  * Performance improvements in fsck.gfs2, mkfs.gfs2 and gfs2_edit 
savemeta.
  * Better checking of journals, the jindex, system inodes and inode 
'goal' values in fsck.gfs2
  * gfs2_jadd and gfs2_grow are now separate programs instead of 
symlinks to mkfs.gfs2.

  * Improved test suite and related documentation.
  * No longer clobbers the configure script's --sbindir option.
  * No longer depends on perl.
  * Various minor bug fixes and enhancements.

See below for a complete list of changes. The source tarball is 
available from:

  https://fedorahosted.org/released/gfs2-utils/gfs2-utils-3.1.8.tar.gz

Please test, and report bugs against the gfs2-utils component of Fedora 
rawhide:


https://bugzilla.redhat.com/enter_bug.cgi?product=Fedoracomponent=gfs2-utilsversion=rawhide

Regards,
Andy

Changes since version 3.1.7:

Abhi Das (6):
  fsck.gfs2: fix broken i_goal values in inodes
  gfs2_convert: use correct i_goal values instead of zeros for inodes
  tests: test for incorrect inode i_goal values
  mkfs.gfs2: addendum to fix broken i_goal values in inodes
  gfs2_utils: more gfs2_convert i_goal fixes
  gfs2-utils: more fsck.gfs2 i_goal fixes

Andrew Price (58):
  gfs2-utils tests: Build unit tests with consistent cpp flags
  libgfs2: Move old rgrp layout functions into fsck.gfs2
  gfs2-utils build: Add test coverage option
  fsck.gfs2: Fix memory leak in pass2
  gfs2_convert: Fix potential memory leaks in adjust_inode
  gfs2_edit: Fix signed value used as array index in print_ld_blks
  gfs2_edit: Set umask before calling mkstemp in savemetaopen()
  gfs2_edit: Fix use-after-free in find_wrap_pt
  libgfs2: Clean up broken rgrp length check
  libgfs2: Remove superfluous NULL check from gfs2_rgrp_free
  libgfs2: Fail fd comparison if the fds are negative
  libgfs2: Fix check for O_RDONLY
  fsck.gfs2: Remove dead code from scan_inode_list
  mkfs.gfs2: Terminate lockproto and locktable strings explicitly
  libgfs2: Add generic field assignment and print functions
  gfs2_edit: Use metadata description to print and assign fields
  gfs2l: Switch to lgfs2_field_assign
  libgfs2: Remove device_name from struct gfs2_sbd
  libgfs2: Remove path_name from struct gfs2_sbd
  libgfs2: metafs_path improvements
  gfs2_grow: Don't use PATH_MAX in main_grow
  gfs2_jadd: Don't use fixed size buffers for paths
  libgfs2: Remove orig_journals from struct gfs2_sbd
  gfs2l: Check unchecked returns in openfs
  gfs2-utils configure: Fix exit with failure condition
  gfs2-utils configure: Remove checks for non-existent -W flags
  gfs2_convert: Don't use a fixed sized buffer for device path
  gfs2_edit: Add bounds checking for the journalN keyword
  libgfs2: Make find_good_lh and jhead_scan static
  Build gfs2_grow, gfs2_jadd and mkfs.gfs2 separately
  gfs2-utils: Honour --sbindir
  gfs2-utils configure: Use AC_HELP_STRING in help messages
  fsck.gfs2: Improve reporting of pass timings
  mkfs.gfs2: Revert default resource group size
  gfs2-utils tests: Add keywords to tests
  gfs2-utils tests: Shorten TESTSUITEFLAGS to TOPTS
  gfs2-utils tests: Improve docs
  gfs2-utils tests: Skip unit tests if check is not found
  gfs2-utils tests: Document usage of convenience macros
  fsck.gfs2: Fix 'initializer element is not constant' build error
  fsck.gfs2: Simplify bad_journalname
  gfs2-utils build: Add a configure script summary
  mkfs.gfs2: Remove unused declarations
  gfs2-utils/tests: Fix unit tests for older check libraries
  fsck.gfs2: Fix memory leaks in pass1_process_rgrp
  libgfs2: Use the correct parent for rgrp tree insertion
  libgfs2: Remove some obsolete function declarations
  gfs2-utils: Move metafs handling into gfs2/mkfs/
  gfs2_grow/jadd: Use a matching context mount option in 
mount_gfs2_meta

  gfs2_edit savemeta: Don't read rgrps twice
  fsck.gfs2: Fetch directory inodes early in pass2()
  libgfs2: Remove some unused data structures
  gfs2-utils: Tidy up Makefile.am files
  gfs2-utils build: Remove superfluous passive header checks
  gfs2-utils: Consolidate some bad constants strings
  gfs2-utils: Update translation template
  libgfs2: Fix potential NULL deref in linked_leaf_search()
  gfs2_grow: Put back the definition of FALLOC_FL_KEEP_SIZE

Bob Peterson (15):
  fsck.gfs2: Detect and correct corrupt journals
  fsck.gfs2: Change basic dentry checks for too long of file names
  fsck.gfs2: Print out block number when pass3 finds a bad directory
  fsck.gfs2: Adjust when hash table is doubled
  fsck.gfs2: Revise undo processing
  fsck.gfs2: remove duplicate designation during undo
  fsck.gfs2: Fix a use-after-free in pass2
  

[Cluster-devel] [GFS2] gfs2: fix quota refresh race in do_glock()

2015-04-07 Thread Abhi Das
quotad periodically syncs in-memory quotas to the ondisk quota file
and sets the QDF_REFRESH flag so that a subsequent read of a synced
quota is re-read from disk.

gfs2_quota_lock() checks for this flag and sets a 'force' bit to
force re-read from disk if requested. However, there is a race
condition here. It is possible for gfs2_quota_lock() to find the
QDF_REFRESH flag unset (i.e force=0) and quotad comes in immediately
after and syncs the relevant quota and sets the QDF_REFRESH flag.
gfs2_quota_lock() resumes with force=0 and uses the stale in-memory
quota usage values that result in miscalculations.

This patch fixes this race by moving the check for the QDF_REFRESH
flag check further out into the gfs2_quota_lock() process, i.e, in
do_glock(), under the protection of the quota glock.

Resolves: rhbz#1174295
Signed-off-by: Abhi Das a...@redhat.com
---
 fs/gfs2/quota.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index 5561468..5c27e48 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -923,6 +923,9 @@ restart:
if (error)
return error;
 
+   if (test_and_clear_bit(QDF_REFRESH, qd-qd_flags))
+   force_refresh = FORCE;
+
qd-qd_qb = *(struct gfs2_quota_lvb *)qd-qd_gl-gl_lksb.sb_lvbptr;
 
if (force_refresh || qd-qd_qb.qb_magic != cpu_to_be32(GFS2_MAGIC)) {
@@ -974,11 +977,8 @@ int gfs2_quota_lock(struct gfs2_inode *ip, kuid_t uid, 
kgid_t gid)
 sizeof(struct gfs2_quota_data *), sort_qd, NULL);
 
for (x = 0; x  ip-i_res-rs_qa_qd_num; x++) {
-   int force = NO_FORCE;
qd = ip-i_res-rs_qa_qd[x];
-   if (test_and_clear_bit(QDF_REFRESH, qd-qd_flags))
-   force = FORCE;
-   error = do_glock(qd, force, ip-i_res-rs_qa_qd_ghs[x]);
+   error = do_glock(qd, NO_FORCE, ip-i_res-rs_qa_qd_ghs[x]);
if (error)
break;
}
-- 
1.8.1.4



Re: [Cluster-devel] [Linux-cluster] gfs2-utils 3.1.8 released

2015-04-07 Thread Digimer
Hi Andrew,

  Congrats!!

  Want to add the cluster labs mailing list to your list of release
announcement locations?

digimer

On 07/04/15 01:03 PM, Andrew Price wrote:
 Hi,
 
 I am happy to announce the 3.1.8 release of gfs2-utils. This release
 includes the following visible changes:
 
   * Performance improvements in fsck.gfs2, mkfs.gfs2 and gfs2_edit
 savemeta.
   * Better checking of journals, the jindex, system inodes and inode
 'goal' values in fsck.gfs2
   * gfs2_jadd and gfs2_grow are now separate programs instead of
 symlinks to mkfs.gfs2.
   * Improved test suite and related documentation.
   * No longer clobbers the configure script's --sbindir option.
   * No longer depends on perl.
   * Various minor bug fixes and enhancements.
 
 See below for a complete list of changes. The source tarball is
 available from:
   https://fedorahosted.org/released/gfs2-utils/gfs2-utils-3.1.8.tar.gz
 
 Please test, and report bugs against the gfs2-utils component of Fedora
 rawhide:
 
 https://bugzilla.redhat.com/enter_bug.cgi?product=Fedoracomponent=gfs2-utilsversion=rawhide
 
 
 Regards,
 Andy
 
 Changes since version 3.1.7:
 
 Abhi Das (6):
   fsck.gfs2: fix broken i_goal values in inodes
   gfs2_convert: use correct i_goal values instead of zeros for inodes
   tests: test for incorrect inode i_goal values
   mkfs.gfs2: addendum to fix broken i_goal values in inodes
   gfs2_utils: more gfs2_convert i_goal fixes
   gfs2-utils: more fsck.gfs2 i_goal fixes
 
 Andrew Price (58):
   gfs2-utils tests: Build unit tests with consistent cpp flags
   libgfs2: Move old rgrp layout functions into fsck.gfs2
   gfs2-utils build: Add test coverage option
   fsck.gfs2: Fix memory leak in pass2
   gfs2_convert: Fix potential memory leaks in adjust_inode
   gfs2_edit: Fix signed value used as array index in print_ld_blks
   gfs2_edit: Set umask before calling mkstemp in savemetaopen()
   gfs2_edit: Fix use-after-free in find_wrap_pt
   libgfs2: Clean up broken rgrp length check
   libgfs2: Remove superfluous NULL check from gfs2_rgrp_free
   libgfs2: Fail fd comparison if the fds are negative
   libgfs2: Fix check for O_RDONLY
   fsck.gfs2: Remove dead code from scan_inode_list
   mkfs.gfs2: Terminate lockproto and locktable strings explicitly
   libgfs2: Add generic field assignment and print functions
   gfs2_edit: Use metadata description to print and assign fields
   gfs2l: Switch to lgfs2_field_assign
   libgfs2: Remove device_name from struct gfs2_sbd
   libgfs2: Remove path_name from struct gfs2_sbd
   libgfs2: metafs_path improvements
   gfs2_grow: Don't use PATH_MAX in main_grow
   gfs2_jadd: Don't use fixed size buffers for paths
   libgfs2: Remove orig_journals from struct gfs2_sbd
   gfs2l: Check unchecked returns in openfs
   gfs2-utils configure: Fix exit with failure condition
   gfs2-utils configure: Remove checks for non-existent -W flags
   gfs2_convert: Don't use a fixed sized buffer for device path
   gfs2_edit: Add bounds checking for the journalN keyword
   libgfs2: Make find_good_lh and jhead_scan static
   Build gfs2_grow, gfs2_jadd and mkfs.gfs2 separately
   gfs2-utils: Honour --sbindir
   gfs2-utils configure: Use AC_HELP_STRING in help messages
   fsck.gfs2: Improve reporting of pass timings
   mkfs.gfs2: Revert default resource group size
   gfs2-utils tests: Add keywords to tests
   gfs2-utils tests: Shorten TESTSUITEFLAGS to TOPTS
   gfs2-utils tests: Improve docs
   gfs2-utils tests: Skip unit tests if check is not found
   gfs2-utils tests: Document usage of convenience macros
   fsck.gfs2: Fix 'initializer element is not constant' build error
   fsck.gfs2: Simplify bad_journalname
   gfs2-utils build: Add a configure script summary
   mkfs.gfs2: Remove unused declarations
   gfs2-utils/tests: Fix unit tests for older check libraries
   fsck.gfs2: Fix memory leaks in pass1_process_rgrp
   libgfs2: Use the correct parent for rgrp tree insertion
   libgfs2: Remove some obsolete function declarations
   gfs2-utils: Move metafs handling into gfs2/mkfs/
   gfs2_grow/jadd: Use a matching context mount option in
 mount_gfs2_meta
   gfs2_edit savemeta: Don't read rgrps twice
   fsck.gfs2: Fetch directory inodes early in pass2()
   libgfs2: Remove some unused data structures
   gfs2-utils: Tidy up Makefile.am files
   gfs2-utils build: Remove superfluous passive header checks
   gfs2-utils: Consolidate some bad constants strings
   gfs2-utils: Update translation template
   libgfs2: Fix potential NULL deref in linked_leaf_search()
   gfs2_grow: Put back the definition of FALLOC_FL_KEEP_SIZE
 
 Bob Peterson (15):
   fsck.gfs2: Detect and correct corrupt journals
   fsck.gfs2: Change basic dentry checks for too long of file names
   

Re: [Cluster-devel] [Linux-cluster] gfs2-utils 3.1.8 released

2015-04-07 Thread Andrew Price

On 08/04/15 01:45, Digimer wrote:

Hi Andrew,

   Congrats!!

   Want to add the cluster labs mailing list to your list of release
announcement locations?

digimer


That's a great idea, I will. I haven't subscribed to the Cluster Labs 
list yet but I'm just about to :)


Thanks,
Andy



On 07/04/15 01:03 PM, Andrew Price wrote:

Hi,

I am happy to announce the 3.1.8 release of gfs2-utils. This release
includes the following visible changes:

   * Performance improvements in fsck.gfs2, mkfs.gfs2 and gfs2_edit
savemeta.
   * Better checking of journals, the jindex, system inodes and inode
'goal' values in fsck.gfs2
   * gfs2_jadd and gfs2_grow are now separate programs instead of
symlinks to mkfs.gfs2.
   * Improved test suite and related documentation.
   * No longer clobbers the configure script's --sbindir option.
   * No longer depends on perl.
   * Various minor bug fixes and enhancements.

See below for a complete list of changes. The source tarball is
available from:
   https://fedorahosted.org/released/gfs2-utils/gfs2-utils-3.1.8.tar.gz

Please test, and report bugs against the gfs2-utils component of Fedora
rawhide:

https://bugzilla.redhat.com/enter_bug.cgi?product=Fedoracomponent=gfs2-utilsversion=rawhide


Regards,
Andy

Changes since version 3.1.7:

Abhi Das (6):
   fsck.gfs2: fix broken i_goal values in inodes
   gfs2_convert: use correct i_goal values instead of zeros for inodes
   tests: test for incorrect inode i_goal values
   mkfs.gfs2: addendum to fix broken i_goal values in inodes
   gfs2_utils: more gfs2_convert i_goal fixes
   gfs2-utils: more fsck.gfs2 i_goal fixes

Andrew Price (58):
   gfs2-utils tests: Build unit tests with consistent cpp flags
   libgfs2: Move old rgrp layout functions into fsck.gfs2
   gfs2-utils build: Add test coverage option
   fsck.gfs2: Fix memory leak in pass2
   gfs2_convert: Fix potential memory leaks in adjust_inode
   gfs2_edit: Fix signed value used as array index in print_ld_blks
   gfs2_edit: Set umask before calling mkstemp in savemetaopen()
   gfs2_edit: Fix use-after-free in find_wrap_pt
   libgfs2: Clean up broken rgrp length check
   libgfs2: Remove superfluous NULL check from gfs2_rgrp_free
   libgfs2: Fail fd comparison if the fds are negative
   libgfs2: Fix check for O_RDONLY
   fsck.gfs2: Remove dead code from scan_inode_list
   mkfs.gfs2: Terminate lockproto and locktable strings explicitly
   libgfs2: Add generic field assignment and print functions
   gfs2_edit: Use metadata description to print and assign fields
   gfs2l: Switch to lgfs2_field_assign
   libgfs2: Remove device_name from struct gfs2_sbd
   libgfs2: Remove path_name from struct gfs2_sbd
   libgfs2: metafs_path improvements
   gfs2_grow: Don't use PATH_MAX in main_grow
   gfs2_jadd: Don't use fixed size buffers for paths
   libgfs2: Remove orig_journals from struct gfs2_sbd
   gfs2l: Check unchecked returns in openfs
   gfs2-utils configure: Fix exit with failure condition
   gfs2-utils configure: Remove checks for non-existent -W flags
   gfs2_convert: Don't use a fixed sized buffer for device path
   gfs2_edit: Add bounds checking for the journalN keyword
   libgfs2: Make find_good_lh and jhead_scan static
   Build gfs2_grow, gfs2_jadd and mkfs.gfs2 separately
   gfs2-utils: Honour --sbindir
   gfs2-utils configure: Use AC_HELP_STRING in help messages
   fsck.gfs2: Improve reporting of pass timings
   mkfs.gfs2: Revert default resource group size
   gfs2-utils tests: Add keywords to tests
   gfs2-utils tests: Shorten TESTSUITEFLAGS to TOPTS
   gfs2-utils tests: Improve docs
   gfs2-utils tests: Skip unit tests if check is not found
   gfs2-utils tests: Document usage of convenience macros
   fsck.gfs2: Fix 'initializer element is not constant' build error
   fsck.gfs2: Simplify bad_journalname
   gfs2-utils build: Add a configure script summary
   mkfs.gfs2: Remove unused declarations
   gfs2-utils/tests: Fix unit tests for older check libraries
   fsck.gfs2: Fix memory leaks in pass1_process_rgrp
   libgfs2: Use the correct parent for rgrp tree insertion
   libgfs2: Remove some obsolete function declarations
   gfs2-utils: Move metafs handling into gfs2/mkfs/
   gfs2_grow/jadd: Use a matching context mount option in
mount_gfs2_meta
   gfs2_edit savemeta: Don't read rgrps twice
   fsck.gfs2: Fetch directory inodes early in pass2()
   libgfs2: Remove some unused data structures
   gfs2-utils: Tidy up Makefile.am files
   gfs2-utils build: Remove superfluous passive header checks
   gfs2-utils: Consolidate some bad constants strings
   gfs2-utils: Update translation template
   libgfs2: Fix potential NULL deref in linked_leaf_search()
   gfs2_grow: Put back the definition of FALLOC_FL_KEEP_SIZE

Bob Peterson (15):