{"thread":{"id":"24383","subject":"[PATCH] Use dev_t for device id (st_dev) from stat in setup_git_directory_gently()","startedAt":"2010-07-13T09:02:00Z","lastAt":"2010-07-14T14:55:56Z","messageCount":6,"participants":["Raja R Harinath","Ævar Arnfjörð Bjarmason","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"145439","messageId":"1279011720-21424-1-git-send-email-harinath@hurrynot.org","threadId":"24383","inReplyTo":null,"subject":"[PATCH] Use dev_t for device id (st_dev) from stat in setup_git_directory_gently()","fromName":"Raja R Harinath","fromEmail":"harinath@hurrynot.org","sentAt":"2010-07-13T09:02:00Z","receivedAt":"2010-07-13T09:02:00Z","isPatch":true,"sender":{"key":"harinath@hurrynot.org","avatar":"https://avatars.githubusercontent.com/u/4610?v=4"},"body":"The original declaration was int, which seems to cause trouble on my\nmachine.  It causes spurious \"filesystem boundary\" errors when running\nthe testsuite.  The cause seems to be\n\n  $ stat -c%d .\n  2147549952\n\nwhich is too large for a 32-bit int type.\n\nUsing the correct type, dev_t, solves the issue.  (Because I'm\nparanoid and forgetful, I checked -- yes, Unix v7 had dev_t.)\n\nOther uses of st_dev seem to be reasonably safe.   fill_stat_cache_info\ntruncates it to an 'unsigned int', but that value seems to be used only\nto validate the cache, and only if USE_STDEV is defined.\n---\n setup.c |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/setup.c b/setup.c\nindex 7e04602..87c21f0 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -323,7 +323,8 @@ const char *setup_git_directory_gently(int *nongit_ok)\n \tconst char *gitdirenv;\n \tconst char *gitfile_dir;\n \tint len, offset, ceil_offset, root_len;\n-\tint current_device = 0, one_filesystem = 1;\n+\tdev_t current_device = 0;\n+\tint one_filesystem = 1;\n \tstruct stat buf;\n \n \t/*\n-- \n1.7.2.rc2.11.g03e33\n"},{"id":"145440","messageId":"AANLkTiku82MylNMUX6P8be3xSLVg8g8aYsNWodaOM6LQ@mail.gmail.com","threadId":"24383","inReplyTo":"1279011720-21424-1-git-send-email-harinath@hurrynot.org","subject":"Re: [PATCH] Use dev_t for device id (st_dev) from stat in setup_git_directory_gently()","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-07-13T09:26:30Z","receivedAt":"2010-07-13T09:26:30Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Tue, Jul 13, 2010 at 09:02, Raja R Harinath <harinath@hurrynot.org> wrote:\n> The original declaration was int, which seems to cause trouble on my\n> machine.\n\nWhat OS/architecture is your machine running?\n"},{"id":"145448","messageId":"87d3ur7fr1.fsf@hariville.hurrynot.org","threadId":"24383","inReplyTo":"AANLkTiku82MylNMUX6P8be3xSLVg8g8aYsNWodaOM6LQ@mail.gmail.com","subject":"Re: [PATCH] Use dev_t for device id (st_dev) from stat in setup_git_directory_gently()","fromName":"Raja R Harinath","fromEmail":"harinath@hurrynot.org","sentAt":"2010-07-13T12:01:06Z","receivedAt":"2010-07-13T12:01:06Z","isPatch":true,"sender":{"key":"harinath@hurrynot.org","avatar":"https://avatars.githubusercontent.com/u/4610?v=4"},"body":"Hi,\n\nÆvar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n> On Tue, Jul 13, 2010 at 09:02, Raja R Harinath <harinath@hurrynot.org> wrote:\n>> The original declaration was int, which seems to cause trouble on my\n>> machine.\n>\n> What OS/architecture is your machine running?\n\nNothing fancy\n\n  $ uname -a\n  Linux hariville.hurrynot.org 2.6.35-rc3-00397-g123f94f #146 SMP PREEMPT Mon Jul 5 15:50:47 IST 2010 x86_64 GNU/Linux\n\n  $ df .\n  Filesystem           1K-blocks      Used Available Use% Mounted on\n  /dev/sda1            959314384 389150456 521433560  43% /\n\n- Hari\n"},{"id":"145460","messageId":"7voceb2jaw.fsf@alter.siamese.dyndns.org","threadId":"24383","inReplyTo":"1279011720-21424-1-git-send-email-harinath@hurrynot.org","subject":"Re: [PATCH] Use dev_t for device id (st_dev) from stat in setup_git_directory_gently()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-07-13T20:55:35Z","receivedAt":"2010-07-13T20:55:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Raja R Harinath <harinath@hurrynot.org> writes:\n\n> The original declaration was int, which seems to cause trouble on my\n> machine.  It causes spurious \"filesystem boundary\" errors when running\n> the testsuite.  The cause seems to be\n>\n>   $ stat -c%d .\n>   2147549952\n>\n> which is too large for a 32-bit int type.\n>\n> Using the correct type, dev_t, solves the issue.  (Because I'm\n> paranoid and forgetful, I checked -- yes, Unix v7 had dev_t.)\n>\n> Other uses of st_dev seem to be reasonably safe.   fill_stat_cache_info\n> truncates it to an 'unsigned int', but that value seems to be used only\n> to validate the cache, and only if USE_STDEV is defined.\n> ---\n\nMakes sense; thanks.\n\nSign-off?\n\n\n>  setup.c |    3 ++-\n>  1 files changed, 2 insertions(+), 1 deletions(-)\n>\n> diff --git a/setup.c b/setup.c\n> index 7e04602..87c21f0 100644\n> --- a/setup.c\n> +++ b/setup.c\n> @@ -323,7 +323,8 @@ const char *setup_git_directory_gently(int *nongit_ok)\n>  \tconst char *gitdirenv;\n>  \tconst char *gitfile_dir;\n>  \tint len, offset, ceil_offset, root_len;\n> -\tint current_device = 0, one_filesystem = 1;\n> +\tdev_t current_device = 0;\n> +\tint one_filesystem = 1;\n>  \tstruct stat buf;\n>  \n>  \t/*\n> -- \n> 1.7.2.rc2.11.g03e33\n"},{"id":"145503","messageId":"878w5elvk2.fsf@hariville.hurrynot.org","threadId":"24383","inReplyTo":"7voceb2jaw.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Use dev_t for device id (st_dev) from stat in setup_git_directory_gently()","fromName":"Raja R Harinath","fromEmail":"harinath@hurrynot.org","sentAt":"2010-07-14T01:08:13Z","receivedAt":"2010-07-14T01:08:13Z","isPatch":true,"sender":{"key":"harinath@hurrynot.org","avatar":"https://avatars.githubusercontent.com/u/4610?v=4"},"body":"Hi,\n\nJunio C Hamano <gitster@pobox.com> writes:\n\n> Raja R Harinath <harinath@hurrynot.org> writes:\n>\n>> The original declaration was int, which seems to cause trouble on my\n>> machine.  It causes spurious \"filesystem boundary\" errors when running\n>> the testsuite.  The cause seems to be\n>>\n>>   $ stat -c%d .\n>>   2147549952\n>>\n>> which is too large for a 32-bit int type.\n>>\n>> Using the correct type, dev_t, solves the issue.  (Because I'm\n>> paranoid and forgetful, I checked -- yes, Unix v7 had dev_t.)\n>>\n>> Other uses of st_dev seem to be reasonably safe.   fill_stat_cache_info\n>> truncates it to an 'unsigned int', but that value seems to be used only\n>> to validate the cache, and only if USE_STDEV is defined.\n>> ---\n>\n> Makes sense; thanks.\n>\n> Sign-off?\n\nSigned-off-by: Raja R Harinath <harinath@hurrynot.org>\n\nDo I need to resend?\n\n>>  setup.c |    3 ++-\n>>  1 files changed, 2 insertions(+), 1 deletions(-)\n>>\n>> diff --git a/setup.c b/setup.c\n>> index 7e04602..87c21f0 100644\n>> --- a/setup.c\n>> +++ b/setup.c\n>> @@ -323,7 +323,8 @@ const char *setup_git_directory_gently(int *nongit_ok)\n>>  \tconst char *gitdirenv;\n>>  \tconst char *gitfile_dir;\n>>  \tint len, offset, ceil_offset, root_len;\n>> -\tint current_device = 0, one_filesystem = 1;\n>> +\tdev_t current_device = 0;\n>> +\tint one_filesystem = 1;\n>>  \tstruct stat buf;\n>>  \n>>  \t/*\n>> -- \n>> 1.7.2.rc2.11.g03e33\n"},{"id":"145541","messageId":"7voceayuwz.fsf@alter.siamese.dyndns.org","threadId":"24383","inReplyTo":"878w5elvk2.fsf@hariville.hurrynot.org","subject":"Re: [PATCH] Use dev_t for device id (st_dev) from stat in setup_git_directory_gently()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-07-14T14:55:56Z","receivedAt":"2010-07-14T14:55:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Raja R Harinath <harinath@hurrynot.org> writes:\n\n> Hi,\n>\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Raja R Harinath <harinath@hurrynot.org> writes:\n>>\n>>> The original declaration was int, which seems to cause trouble on my\n>>> machine.  It causes spurious \"filesystem boundary\" errors when running\n>>> the testsuite.  The cause seems to be\n>>>\n>>>   $ stat -c%d .\n>>>   2147549952\n>>>\n>>> which is too large for a 32-bit int type.\n>>>\n>>> Using the correct type, dev_t, solves the issue.  (Because I'm\n>>> paranoid and forgetful, I checked -- yes, Unix v7 had dev_t.)\n>>>\n>>> Other uses of st_dev seem to be reasonably safe.   fill_stat_cache_info\n>>> truncates it to an 'unsigned int', but that value seems to be used only\n>>> to validate the cache, and only if USE_STDEV is defined.\n>>> ---\n>>\n>> Makes sense; thanks.\n>>\n>> Sign-off?\n>\n> Signed-off-by: Raja R Harinath <harinath@hurrynot.org>\n>\n> Do I need to resend?\n\nNo.  Again thanks for a fix.\n\n>>>  setup.c |    3 ++-\n>>>  1 files changed, 2 insertions(+), 1 deletions(-)\n>>>\n>>> diff --git a/setup.c b/setup.c\n>>> index 7e04602..87c21f0 100644\n>>> --- a/setup.c\n>>> +++ b/setup.c\n>>> @@ -323,7 +323,8 @@ const char *setup_git_directory_gently(int *nongit_ok)\n>>>  \tconst char *gitdirenv;\n>>>  \tconst char *gitfile_dir;\n>>>  \tint len, offset, ceil_offset, root_len;\n>>> -\tint current_device = 0, one_filesystem = 1;\n>>> +\tdev_t current_device = 0;\n>>> +\tint one_filesystem = 1;\n>>>  \tstruct stat buf;\n>>>  \n>>>  \t/*\n>>> -- \n>>> 1.7.2.rc2.11.g03e33\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"}]}