]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 11 Oct 2014 12:02:31 +0000 (08:02 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 11 Oct 2014 12:02:31 +0000 (08:02 -0400)
Pull UDF and quota updates from Jan Kara:
 "A few UDF fixes and also a few patches which are preparing filesystems
  for support of project quotas in VFS"

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  udf: Fix loading of special inodes
  ocfs2: Back out change to use OCFS2_MAXQUOTAS in ocfs2_setattr()
  udf: remove redundant sys_tz declaration
  ocfs2: Don't use MAXQUOTAS value
  reiserfs: Don't use MAXQUOTAS value
  ext3: Don't use MAXQUOTAS value
  udf: Fix race between write(2) and close(2)

1  2 
fs/ext3/super.c
fs/ocfs2/file.c
fs/ocfs2/super.c

diff --combined fs/ext3/super.c
index bb0fdacad058a5b1296a0b27e46f567fe1c29be6,b79f04bf72fcdc727dd82f00c0d64b65bb7a45f0..7015db0bafd1b0c3179e6a9eb8de8c1e06465751
@@@ -441,7 -441,7 +441,7 @@@ static void ext3_put_super (struct supe
        percpu_counter_destroy(&sbi->s_dirs_counter);
        brelse(sbi->s_sbh);
  #ifdef CONFIG_QUOTA
-       for (i = 0; i < MAXQUOTAS; i++)
+       for (i = 0; i < EXT3_MAXQUOTAS; i++)
                kfree(sbi->s_qf_names[i]);
  #endif
  
@@@ -1555,7 -1555,7 +1555,7 @@@ static void ext3_orphan_cleanup (struc
        /* Needed for iput() to work correctly and not trash data */
        sb->s_flags |= MS_ACTIVE;
        /* Turn on quotas so that they are updated correctly */
-       for (i = 0; i < MAXQUOTAS; i++) {
+       for (i = 0; i < EXT3_MAXQUOTAS; i++) {
                if (EXT3_SB(sb)->s_qf_names[i]) {
                        int ret = ext3_quota_on_mount(sb, i);
                        if (ret < 0)
                       PLURAL(nr_truncates));
  #ifdef CONFIG_QUOTA
        /* Turn quotas off */
-       for (i = 0; i < MAXQUOTAS; i++) {
+       for (i = 0; i < EXT3_MAXQUOTAS; i++) {
                if (sb_dqopt(sb)->files[i])
                        dquot_quota_off(sb, i);
        }
@@@ -2039,14 -2039,14 +2039,14 @@@ static int ext3_fill_super (struct supe
                goto failed_mount2;
        }
        err = percpu_counter_init(&sbi->s_freeblocks_counter,
 -                      ext3_count_free_blocks(sb));
 +                      ext3_count_free_blocks(sb), GFP_KERNEL);
        if (!err) {
                err = percpu_counter_init(&sbi->s_freeinodes_counter,
 -                              ext3_count_free_inodes(sb));
 +                              ext3_count_free_inodes(sb), GFP_KERNEL);
        }
        if (!err) {
                err = percpu_counter_init(&sbi->s_dirs_counter,
 -                              ext3_count_dirs(sb));
 +                              ext3_count_dirs(sb), GFP_KERNEL);
        }
        if (err) {
                ext3_msg(sb, KERN_ERR, "error: insufficient memory");
@@@ -2139,7 -2139,7 +2139,7 @@@ failed_mount2
        kfree(sbi->s_group_desc);
  failed_mount:
  #ifdef CONFIG_QUOTA
-       for (i = 0; i < MAXQUOTAS; i++)
+       for (i = 0; i < EXT3_MAXQUOTAS; i++)
                kfree(sbi->s_qf_names[i]);
  #endif
        ext3_blkdev_remove(sbi);
@@@ -2659,7 -2659,7 +2659,7 @@@ static int ext3_remount (struct super_b
        old_opts.s_commit_interval = sbi->s_commit_interval;
  #ifdef CONFIG_QUOTA
        old_opts.s_jquota_fmt = sbi->s_jquota_fmt;
-       for (i = 0; i < MAXQUOTAS; i++)
+       for (i = 0; i < EXT3_MAXQUOTAS; i++)
                if (sbi->s_qf_names[i]) {
                        old_opts.s_qf_names[i] = kstrdup(sbi->s_qf_names[i],
                                                         GFP_KERNEL);
        }
  #ifdef CONFIG_QUOTA
        /* Release old quota file names */
-       for (i = 0; i < MAXQUOTAS; i++)
+       for (i = 0; i < EXT3_MAXQUOTAS; i++)
                kfree(old_opts.s_qf_names[i]);
  #endif
        if (enable_quota)
@@@ -2777,7 -2777,7 +2777,7 @@@ restore_opts
        sbi->s_commit_interval = old_opts.s_commit_interval;
  #ifdef CONFIG_QUOTA
        sbi->s_jquota_fmt = old_opts.s_jquota_fmt;
-       for (i = 0; i < MAXQUOTAS; i++) {
+       for (i = 0; i < EXT3_MAXQUOTAS; i++) {
                kfree(sbi->s_qf_names[i]);
                sbi->s_qf_names[i] = old_opts.s_qf_names[i];
        }
diff --combined fs/ocfs2/file.c
index 682732f3f0d8fcb4b7fd8a7e96ebbab3d9e706ba,f39482ee22f0cd04a783deda534b8e880c597f19..324dc93ac896c073886846e0d883d1d8f5bd30ca
@@@ -760,7 -760,7 +760,7 @@@ static int ocfs2_write_zero_page(struc
        struct address_space *mapping = inode->i_mapping;
        struct page *page;
        unsigned long index = abs_from >> PAGE_CACHE_SHIFT;
 -      handle_t *handle = NULL;
 +      handle_t *handle;
        int ret = 0;
        unsigned zero_from, zero_to, block_start, block_end;
        struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data;
        BUG_ON(abs_to > (((u64)index + 1) << PAGE_CACHE_SHIFT));
        BUG_ON(abs_from & (inode->i_blkbits - 1));
  
 +      handle = ocfs2_zero_start_ordered_transaction(inode, di_bh);
 +      if (IS_ERR(handle)) {
 +              ret = PTR_ERR(handle);
 +              goto out;
 +      }
 +
        page = find_or_create_page(mapping, index, GFP_NOFS);
        if (!page) {
                ret = -ENOMEM;
                mlog_errno(ret);
 -              goto out;
 +              goto out_commit_trans;
        }
  
        /* Get the offsets within the page that we want to zero */
                        goto out_unlock;
                }
  
 -              if (!handle) {
 -                      handle = ocfs2_zero_start_ordered_transaction(inode,
 -                                                                    di_bh);
 -                      if (IS_ERR(handle)) {
 -                              ret = PTR_ERR(handle);
 -                              handle = NULL;
 -                              break;
 -                      }
 -              }
  
                /* must not update i_size! */
                ret = block_commit_write(page, block_start + 1,
                        ret = 0;
        }
  
 +      /*
 +       * fs-writeback will release the dirty pages without page lock
 +       * whose offset are over inode size, the release happens at
 +       * block_write_full_page().
 +       */
 +      i_size_write(inode, abs_to);
 +      inode->i_blocks = ocfs2_inode_sector_count(inode);
 +      di->i_size = cpu_to_le64((u64)i_size_read(inode));
 +      inode->i_mtime = inode->i_ctime = CURRENT_TIME;
 +      di->i_mtime = di->i_ctime = cpu_to_le64(inode->i_mtime.tv_sec);
 +      di->i_ctime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec);
 +      di->i_mtime_nsec = di->i_ctime_nsec;
        if (handle) {
 -              /*
 -               * fs-writeback will release the dirty pages without page lock
 -               * whose offset are over inode size, the release happens at
 -               * block_write_full_page().
 -               */
 -              i_size_write(inode, abs_to);
 -              inode->i_blocks = ocfs2_inode_sector_count(inode);
 -              di->i_size = cpu_to_le64((u64)i_size_read(inode));
 -              inode->i_mtime = inode->i_ctime = CURRENT_TIME;
 -              di->i_mtime = di->i_ctime = cpu_to_le64(inode->i_mtime.tv_sec);
 -              di->i_ctime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec);
 -              di->i_mtime_nsec = di->i_ctime_nsec;
                ocfs2_journal_dirty(handle, di_bh);
                ocfs2_update_inode_fsync_trans(handle, inode, 1);
 -              ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle);
        }
  
  out_unlock:
        unlock_page(page);
        page_cache_release(page);
 +out_commit_trans:
 +      if (handle)
 +              ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle);
  out:
        return ret;
  }
@@@ -1252,7 -1253,7 +1252,7 @@@ bail
        brelse(bh);
  
        /* Release quota pointers in case we acquired them */
-       for (qtype = 0; qtype < MAXQUOTAS; qtype++)
+       for (qtype = 0; qtype < OCFS2_MAXQUOTAS; qtype++)
                dqput(transfer_to[qtype]);
  
        if (!status && attr->ia_valid & ATTR_MODE) {
diff --combined fs/ocfs2/super.c
index 4142546aedae95e668487b9ba8069be1ec929227,aa35d6309b93beb640d12fd31aa20d1110b7cfe0..93c85bc745e199983550b2e181b757e151cec8d5
@@@ -899,11 -899,12 +899,12 @@@ static int ocfs2_susp_quotas(struct ocf
  {
        int type;
        struct super_block *sb = osb->sb;
-       unsigned int feature[MAXQUOTAS] = { OCFS2_FEATURE_RO_COMPAT_USRQUOTA,
-                                            OCFS2_FEATURE_RO_COMPAT_GRPQUOTA};
+       unsigned int feature[OCFS2_MAXQUOTAS] = {
+                                       OCFS2_FEATURE_RO_COMPAT_USRQUOTA,
+                                       OCFS2_FEATURE_RO_COMPAT_GRPQUOTA};
        int status = 0;
  
-       for (type = 0; type < MAXQUOTAS; type++) {
+       for (type = 0; type < OCFS2_MAXQUOTAS; type++) {
                if (!OCFS2_HAS_RO_COMPAT_FEATURE(sb, feature[type]))
                        continue;
                if (unsuspend)
  
  static int ocfs2_enable_quotas(struct ocfs2_super *osb)
  {
-       struct inode *inode[MAXQUOTAS] = { NULL, NULL };
+       struct inode *inode[OCFS2_MAXQUOTAS] = { NULL, NULL };
        struct super_block *sb = osb->sb;
-       unsigned int feature[MAXQUOTAS] = { OCFS2_FEATURE_RO_COMPAT_USRQUOTA,
-                                            OCFS2_FEATURE_RO_COMPAT_GRPQUOTA};
-       unsigned int ino[MAXQUOTAS] = { LOCAL_USER_QUOTA_SYSTEM_INODE,
+       unsigned int feature[OCFS2_MAXQUOTAS] = {
+                                       OCFS2_FEATURE_RO_COMPAT_USRQUOTA,
+                                       OCFS2_FEATURE_RO_COMPAT_GRPQUOTA};
+       unsigned int ino[OCFS2_MAXQUOTAS] = {
+                                       LOCAL_USER_QUOTA_SYSTEM_INODE,
                                        LOCAL_GROUP_QUOTA_SYSTEM_INODE };
        int status;
        int type;
  
        sb_dqopt(sb)->flags |= DQUOT_QUOTA_SYS_FILE | DQUOT_NEGATIVE_USAGE;
-       for (type = 0; type < MAXQUOTAS; type++) {
+       for (type = 0; type < OCFS2_MAXQUOTAS; type++) {
                if (!OCFS2_HAS_RO_COMPAT_FEATURE(sb, feature[type]))
                        continue;
                inode[type] = ocfs2_get_system_file_inode(osb, ino[type],
                        goto out_quota_off;
        }
  
-       for (type = 0; type < MAXQUOTAS; type++)
+       for (type = 0; type < OCFS2_MAXQUOTAS; type++)
                iput(inode[type]);
        return 0;
  out_quota_off:
        ocfs2_disable_quotas(osb);
-       for (type = 0; type < MAXQUOTAS; type++)
+       for (type = 0; type < OCFS2_MAXQUOTAS; type++)
                iput(inode[type]);
        mlog_errno(status);
        return status;
@@@ -972,7 -975,7 +975,7 @@@ static void ocfs2_disable_quotas(struc
  
        /* We mostly ignore errors in this function because there's not much
         * we can do when we see them */
-       for (type = 0; type < MAXQUOTAS; type++) {
+       for (type = 0; type < OCFS2_MAXQUOTAS; type++) {
                if (!sb_has_quota_loaded(sb, type))
                        continue;
                /* Cancel periodic syncing before we grab dqonoff_mutex */
  /* Handle quota on quotactl */
  static int ocfs2_quota_on(struct super_block *sb, int type, int format_id)
  {
-       unsigned int feature[MAXQUOTAS] = { OCFS2_FEATURE_RO_COMPAT_USRQUOTA,
-                                            OCFS2_FEATURE_RO_COMPAT_GRPQUOTA};
+       unsigned int feature[OCFS2_MAXQUOTAS] = {
+                                       OCFS2_FEATURE_RO_COMPAT_USRQUOTA,
+                                       OCFS2_FEATURE_RO_COMPAT_GRPQUOTA};
  
        if (!OCFS2_HAS_RO_COMPAT_FEATURE(sb, feature[type]))
                return -EINVAL;
@@@ -2532,7 -2536,6 +2536,7 @@@ static void ocfs2_delete_osb(struct ocf
        kfree(osb->journal);
        kfree(osb->local_alloc_copy);
        kfree(osb->uuid_str);
 +      kfree(osb->vol_label);
        ocfs2_put_dlm_debug(osb->osb_dlm_debug);
        memset(osb, 0, sizeof(struct ocfs2_super));
  }